Colour Names¶
The machine shows 256 colours: three bits of red, three of green, two of blue, packed into
one byte (RGB332). Anywhere a colour is asked for you can write that byte — 0x1F — but
most of them have a name as well, and a name is what keeps a file a person edits a file a
person can read.
The names are the web's, mapped onto the 256 this machine has. Mapping them collapses some (a 3-3-2 grid cannot tell ivory from snow), so the list comes in two parts: 78 names, one per distinct colour, and 23 further spellings that land on a colour already in the list. Both are understood; the 78 are what a picker offers back, and what a file is written with.
The 78¶
The swatches are the colour as the machine expands it, so a name that looks approximate here looks the same on the screen.
black0x00
white0xFF
red0xE0
lime0x1C
blue0x03
yellow0xFC
cyan0x1F
magenta0xE3
silver0xB6
gray0x92
maroon0x80
olive0x90
green0x10
purple0x82
teal0x12
navy0x02
orange0xF4
gold0xF8
pink0xF6
hotpink0xEE
deeppink0xE6
crimson0xC5
firebrick0xA4
tomato0xED
salmon0xF1
orangered0xE8
darkorange0xF0
khaki0xFA
tan0xD6
peru0xD1
chocolate0xCC
saddlebrown0x88
sienna0x89
darkkhaki0xB5
yellowgreen0x99
olivedrab0x70
greenyellow0xBD
chartreuse0x7C
springgreen0x1D
limegreen0x39
forestgreen0x30
darkgreen0x0C
seagreen0x31
mediumseagreen0x55
lightgreen0x9E
darkseagreen0x96
aquamarine0x7E
turquoise0x5A
darkturquoise0x1A
lightseagreen0x36
lightcyan0xDF
paleturquoise0xBF
powderblue0xBB
skyblue0x9B
deepskyblue0x17
dodgerblue0x33
cornflowerblue0x73
steelblue0x52
royalblue0x4F
midnightblue0x25
slateblue0x6A
mediumpurple0x8F
blueviolet0x87
darkorchid0x86
mediumorchid0xAA
orchid0xCF
violet0xF3
plum0xD3
thistle0xD7
lavender0xDB
indigo0x42
mediumvioletred0xA6
palevioletred0xCE
mistyrose0xFB
lightgray0xDA
dimgray0x6D
lightslategray0x72
darkslategray0x29
Also understood¶
Written in a file or typed at the shell, each of these is accepted and resolves to the colour beside it. Ask for the name back and you get that one.
| Also understood | Lands on | |
|---|---|---|
darkred |
maroon |
0x80 |
coral |
tomato |
0xED |
lightyellow |
white |
0xFF |
ivory |
white |
0xFF |
beige |
white |
0xFF |
wheat |
khaki |
0xFA |
brown |
firebrick |
0xA4 |
lawngreen |
chartreuse |
0x7C |
palegreen |
lightgreen |
0x9E |
darkcyan |
teal |
0x12 |
mediumblue |
navy |
0x02 |
darkblue |
navy |
0x02 |
darkviolet |
purple |
0x82 |
darkmagenta |
purple |
0x82 |
lightpink |
pink |
0xF6 |
darkgray |
silver |
0xB6 |
slategray |
lightslategray |
0x72 |
gainsboro |
lavender |
0xDB |
whitesmoke |
white |
0xFF |
snow |
white |
0xFF |
azure |
white |
0xFF |
honeydew |
white |
0xFF |
linen |
white |
0xFF |
Where a name works¶
/home/colors.toml |
bg = "midnightblue" |
The shell's color command |
color bg skyblue, and color names lists the 78 |
| The editor's Colors dialog | It writes the same file |
An app, through FmrbColors |
Below |
From an app (FmrbColors)¶
| Method | |
|---|---|
FmrbColors.by_name("skyblue") |
The value, or nil when it is not one of ours |
FmrbColors.to_color(str) |
The same, but "0x1F" and "31" are accepted too |
FmrbColors.to_text(value) |
Its name, or "0x1F" when it has none. This is what gets written to a file |
FmrbColors.name_of(value) |
Its name, or nil |
FmrbColors.palette_size / name_at(i) / palette_value(i) |
Walking the 78, which is how a picker is built |
FmrbColors.shade(colour, avoid = nil) |
A step darker, or lighter when darker would land on avoid or on the colour itself. The editor's bars are made this way |
FmrbColors.section("editor") |
That section of the user's colours file, as a Hash |
A name that is not one of ours gives nil rather than a colour. That is deliberate: a typo
in a colours file leaves the theme colour in place instead of painting the app black.
Related¶
- Colours (
colors.toml) — overriding an app's colours - System Config — the nine colours of the system theme
- Drawing —
FmrbGfx's own colour constants, and RGB332