# Draw the rainbow

The challenge is simple: Draw a rainbow in as few bytes as possible

The specs for the rainbow are as follows:

• The figure must be exactly 400 pixels wide and 200 pixels high (optionally 401x201 if you want a single center pixel)
• The red ring should touch all borders of the figure (outer radius = 200 pixels)
• All rings shall have the same width (10 pixels)
• The violet ring shall have an inner radius of 130 pixels
• The bow should be the upper half of a perfect circle
• The background shall be white (transparent is also accepted)
• The figure shall not have borders, (exception is made if the border can't be suppressed)
• Builtin rainbow making functions are not allowed!

The following colors are to be used in the rainbow:

This is code golf, so the shortest code in bytes win!

Example:

Related, but different!

• Builtin rainbow making functions are not allowed As I'm sure Mathematica has one Mar 11, 2016 at 23:05
• How imperfect may the rainbow be? From not anti-aliased to tearing? Consider the images in this answer Mar 15, 2016 at 15:53
• @aross: it should look like the sample rainbow (some pixels may vary due to inaccurate calculations). The two last rainbows are too "messy", while the first one looks ok. I don't have a perfect rule, so use you best judgement :-) Mar 15, 2016 at 16:12
• @StewieGriffin Reason I'm asking is because apparently PHP graphics is pretty buggy, while the solution is correct in theory. Well, the second one is, the third one would be with anti-aliasing (which also doesn't work well) Mar 15, 2016 at 16:16
• Are vector graphics not allowed? edit: never mind—I see that there's already a TikZ answer, so I gather they are. Apr 23, 2017 at 16:52

# LibreLogo, 129 bytes

Code:

x=307 ps 7 fc [3]for i in [[5],0xff7f00,[11],65280,255,4915330,9371903][ x-=14 pc i circle x ]ps 0 pc [3]rt 180 fd 152 square 300


Result:

Explanation:

x = 307                                                          ; Circle Width = 307 pt
ps 7                                                             ; Pen Size = 7 pt
fc [3]                                                           ; Fill Color = #ffffff
for i in [[5], 0xff7f00, [11], 65280, 255, 4915330, 9371903] [   ; For each Rainbow Color
x -= 14                                                      ; Circle Width -= 14 pt
pc i                                                         ; Pen Color = Rainbow Color
circle x                                                     ; Draw Circle (Circle Width)
]
ps 0                                                             ; Pen Size = 0
pc [3]                                                           ; Pen Color = #ffffff
rt 180                                                           ; Right 180°
fd 152                                                           ; Forward 152 pt
square 300                                                       ; Draw Square (300 pt)