These are common enough (especially on the web) that a new user might try to use a 3-digit hex color such as #f00 (or one with transparency such as #f008). We might as well make this work and save a few seconds of confusion/RTFM.
Also, print the "Invalid color" message if the color string is of an allowed length, but not parseable as a hex color (example: #bruh). No reason to be as lenient as HTML.
These are common enough (especially on the web) that a new user might try to use a 3-digit hex color such as
#f00
(or one with transparency such as#f008
). We might as well make this work and save a few seconds of confusion/RTFM.Also, print the "Invalid color" message if the color string is of an allowed length, but not parseable as a hex color (example:
#bruh
). No reason to be as lenient as HTML.