Minecraft doesn't have rainbows unless you want to gather thousands of blocks of wool to build one by yourself. Even then, it's physical, rather than a part of the sky like the clouds, sun, and moon, but new display entities allow data pack creators to put together (almost) proper rainbows at long last.
I say almost because they're completely straight, firing off in one direction like the Bifrost bridge rather than arching as real-life rainbows do. Still, it's a whole lot closer than we've ever gotten in vanilla Minecraft.
RELATED: Minecraft Player Uses New Snapshot To Create Working Physics
Surprisingly, this doesn't require a wall of commands to work - if you have a resource pack (as u/Ercerus does), you can use one block and one command to create the rainbow effect. This is because the command stretches a single block, which in this case is an altered white stained glass pane. If you were to use seven blocks of coloured wool, it would take seven lines of code, but you'd get a similar effect without having to download anything extra.
The downside is that you can only scale, rotate, and shear the block. You can't curve it. As such, when you drag out, in this case, a glass pane with a rainbow skin, it appears as a massively stretched version of that block. Bending it isn't possible, yet, but as u/Sany_Wave says, "I think it's more realistic considering [Minecraft] physics."
Knowing Minecrafters, someone will find a way to make it perfectly curve one of these days, though a perfectly curved rainbow somehow feels more cursed in a game made entirely out of squares and blocks.
If you fancy giving it a go yourself, this is the exact code that u/Ercerus used, but they have a resource pack that changes the white stained
Read more on thegamer.com