|
 |
Ok, since some avians request amphibians to post something, here
something goes.
For a long time I'm bored by the fact that, when I need some named
colors in 0..1 range (like required by POV-Ray), I find them in 0.255
range at best (at worst they are hexed).
Today I felt like I need having some color gradient to height color my
img2mesh output to make it look like printed map coloring, and the first
thing I found was:
https://www.cartotype.com/developers/documentation/style-sheets/terrain-shading-and-coloring
but surely they are referring to SVG named colors!
At this point my patience got exhausted, depleted etc., so I copy/pasted
text from:
https://www.w3.org/TR/SVG11/types.html#ColorKeywords
with a little search/replace turned into a form of Python dictionary,
which turned into a file which, being run, exports all these colors in
the form of POV-Ray .inc file.
Resulting .inc file attached in case someone need these named colors.
Python file attached as well in case someone wish to change something in
output format, like rounding (currently set to 3 decimals) etc.
Note that Python program writes its output in default working directory,
which normally is the directory the program is placed to.
Note that color names are processed with .title() to make them start
with Cap to avoid conflicts with POV-Ray keywords like "blue"; maybe
someone prefer other naming scheme (like adding "_" or something), feel
free to edit the program.
Anyway, now I do post something, and it's your turn.
--
Ilyich the Toad
https://dnyarri.github.io/
Post a reply to this message
Attachments:
Download 'svg_colors.inc.txt' (8 KB)
Download 'svg_recognized_color_keyword_names.py.txt' (6 KB)
|
 |