Output the HTML colors The 16-color CGA palette (also known as the HTML colors) is a set of 16 colors used by early graphics adapters. The goal of this challenge is to output all 16 of them, in hex format (RRGGBB), in ascending order by hex value, separated by newlines. Thus, the output should be exactly this:

000000
000080
0000FF
008000
008080
00FF00
00FFFF
800000
800080
808000
808080
C0C0C0
FF0000
FF00FF
FFFF00
FFFFFF


A single trailing newline is allowed, but not required.
Jelly, 31 29 27 bytes

“×Ɗ¡‘ŒP»Ṫ¦209ṗ€3Fd⁴ịØHs3ṢQY


Try it online!

How it works

“×Ɗ¡‘ yield the code points of the characters between the quotes in Jelly's SBCS, which are 0x11 = 17, 0x91 = 145, and 0x00 = 0.

ŒP constructs the powerset of the array of code points, yielding

[[], [17], [145], [0], [17, 145], [17, 0], [145, 0], [17, 145, 0]]


The last two entries correspond to combinations that contain both 80 and FF, so we have to discard them.

»Ṫ¦209 consists of three parts:


Ṫ (tail) removes the last array of code points, i.e., [17, 145, 0].
»209 takes the maximum of each integer in the remainder of the powerset and 0xD1 = 209, replacing all of them with 209.
¦ (sparse) iterates over the elements of the remainder of the powerset. If the corresponding index is found in [17, 145, 0], the element is replaced with all 209's. If not, it is left untouched.

¦ isn't modular, so this modifies only the last array (index 0) in the remainder of the powerset. The indices 17 and 145 are too large and have no effect.


The result is as follows.

[[], [17], [145], [0], [17, 145], [17, 0], [209, 209]]


ṗ€3 computes the third Cartesian power of each array, i.e., the array of all 3-tuples of elements of each array.

Fd⁴ flattens the result and computes quotient and remainder of each integer divided by 16.

ịØH indexes (1-based) into "0123456789ABCDEF, so 0x11, 0x91, 0x00, and 0xD1 get mapped to "00", "80", "FF", and "C0" (resp.).

s3ṢQ splits the character pairs into 3-tuples, sorts the tuples, and deduplicates.

Finally, Y joins the unique tuples, separating by linefeeds.