POV-Ray : Newsgroups : povray.general : SVG Recognized colors Server Time
28 Mar 2026 16:48:15 EDT (-0400)
  SVG Recognized colors (Message 4 to 13 of 14)  
<<< Previous 3 Messages Goto Latest 10 Messages Next 1 Messages >>>
From: Ilya Razmanov
Subject: Re: SVG Recognized colors
Date: 26 Mar 2026 07:02:52
Message: <69c5125c$1@news.povray.org>
On 26.03.2026 11:15, jr wrote:
> 
> after reading CR's reply, I'd like to add that POV-Ray include files, ideally,
> should be "idempotent", too.  have attached a copy of a generated
> 'svg_colors.inc' post-processed (and renamed to fit :-)).
> 

Unfortunately, I understand neither what "idempotent" mean nor what all 
these

#ifdef(View_POV_Include_Stack)
#debug "including colours_svg.inc\n"
#end

are good for ;-). Therefore I'm afraid I can't make my script any 
better, except for changing "rgb" to "srgb" (that's the only part I 
understand).

Well, on the other hand, there seem to be one more thing I understand: 
many colors in standard "colors.inc" seem to be named just like that 
would be in exported inc, and I'm too lazy to check them all for 
conflicts in case of importing both files. Perharps it would be better 
to change naming convention from color_name.title() (i.e., "blue" to 
"Blue") to, say, color_name.capitalize() (i.e., "blue" to "BLUE")? Or 
may be use prefixes, like "blue" to "svg_blue" or something?

-- 
Ilyich the Toad
https://dnyarri.github.io/


Post a reply to this message

From: jr
Subject: Re: SVG Recognized colors
Date: 26 Mar 2026 07:40:00
Message: <web.69c51ad3d157b00d48bf72fa6cde94f1@news.povray.org>
hi,

Ilya Razmanov <ily### [at] gmailcom> wrote:
> On 26.03.2026 11:15, jr wrote:
> >
> > after reading CR's reply, I'd like to add that POV-Ray include files, ideally,
> > should be "idempotent", too.  have attached a copy of a generated
> > 'svg_colors.inc' post-processed (and renamed to fit :-)).
> >
>
> Unfortunately, I understand neither what "idempotent" mean nor what all
> these

idempotent -- in this context, if I were to have a '#include "colours_svg.inc'"
line in every one of my scene and include files, only the first one seen by the
parser gets processed in full, all subsequent ones will not (as the guard
('colours_svg_include_temp') is already defined).
<en.wiktionary.org/wiki/idempotent>


> #ifdef(View_POV_Include_Stack)
> #debug "including colours_svg.inc\n"
> #end

if you'll have a look at the distribution '.inc' files, you will notice those
same lines.  if you declare the 'View_POV_Include_Stack' variable in a scene
_before_ the scene file's "#include" lines, POV-Ray will print the name of each
as it gets parsed.


> are good for ;-). Therefore I'm afraid I can't make my script any
> better, except for changing "rgb" to "srgb" (that's the only part I
> understand).

well, I don't "speak" Python, so cannot do so either.


> Well, on the other hand, there seem to be one more thing I understand:
> many colors in standard "colors.inc" seem to be named just like that
> would be in exported inc, and I'm too lazy to check them all for
> conflicts in case of importing both files. Perharps it would be better
> to change naming convention from color_name.title() (i.e., "blue" to
> "Blue") to, say, color_name.capitalize() (i.e., "blue" to "BLUE")? Or
> may be use prefixes, like "blue" to "svg_blue" or something?

fwiw, personal opinion, the colour names are fine as is.


regards, jr.


Post a reply to this message

From: Ilya Razmanov
Subject: Re: SVG Recognized colors
Date: 26 Mar 2026 08:40:55
Message: <69c52957$1@news.povray.org>
On 26.03.2026 14:38, jr wrote:

> well, I don't "speak" Python, so cannot do so either.

Well, initially my pythonic part consisted of three things:

1) One "with open..." for file handling.
2) One "for" loop for dictionary iterating.
3) One file .write with f-string, combining dictionary keys and values 
with POV-Ray syntax elements.

All the rest of the file consisted of 147 dictionary entries, whose keys 
and values were directly copied from W3C site.

Main reasons for doing all this with Python were:

1) I'm too lazy to think of search and replace sequence for transforming 
W3C source into POV-Ray, "let the iron mechanism work";
2) Now it's extremely easy to change things en masse by, say, editing 
that single f-string.

But now I tried to address all the issues mentioned in both replies, so 
my pythonic code like quadrupled in size ;-)

Here go the updated version (and exported .inc example for those who 
loathe to touch Python). Note that file name to be inserted here and 
there in all these "include_temp" is defined within program, so it's 
easy to edit it with notepad - all the "doing" code goes after 
dictionary definition, which, considering code and dictionary relative 
sizes, means "at the very end of Python file".

-- 
Ilyich the Toad
https://dnyarri.github.io/


Post a reply to this message


Attachments:
Download 'svg_recognized_color_keyword_names.py.txt' (7 KB) Download 'svg_colors.inc.txt' (8 KB)

From: Bald Eagle
Subject: Re: SVG Recognized colors
Date: 26 Mar 2026 08:50:00
Message: <web.69c52b2fd157b00d7ca0eb7925979125@news.povray.org>
That's the second time TODAY that I've seen the word "idempotent".
Spooky.  But an excellent goal to set for all code.

Also applicable to the keyword project I was discussing, with regard to
self-documenting.

As Richard stated:
"Note that the `srgb` keyword will yield consistent colors
regardless of your assumed_gamma setting."

So, if we are using assumed_gamma 1.0 for all scenes, then why are we even using
rgb?   If everything is implemented from here forward using srgb, then
everything should be good, right?   N^1 = N.

Now, I often have to do experimentation where I modify colors from rgb to rgbf
to rgbt to maybe rgbft, and that gets to be a pain to go back and rewrite all
the keywords and color vectors.

Having worked out a fairly robust system for handling vector arity, I'm
considering just making some kind of all-purpose color macro, that detects the
size of the color vector and emits the appropriate keyword.

- BE


Post a reply to this message

From: jr
Subject: Re: SVG Recognized colors
Date: 26 Mar 2026 09:35:00
Message: <web.69c53575d157b00d48bf72fa6cde94f1@news.povray.org>
hi,

Ilya Razmanov <ily### [at] gmailcom> wrote:
> On 26.03.2026 14:38, jr wrote:
> > well, I don't "speak" Python, so cannot do so either.
> Well, initially my pythonic part consisted of three things:
> ...
> But now I tried to address all the issues mentioned in both replies, so
> my pythonic code like quadrupled in size ;-)
>
> Here go the updated version (and exported .inc example ...

super.  one small oversight (sorry :-)), all '#debug' statements need an
explicit '\n' to "show".


regards, jr.


Post a reply to this message

From: Cousin Ricky
Subject: Re: SVG Recognized colors
Date: 26 Mar 2026 10:49:57
Message: <69c54795$1@news.povray.org>
On 2026-03-25 18:02 (-4), Cousin Ricky wrote:
> Ilya Razmanov <ily### [at] gmailcom> wrote:
>> [snip]
>>
>> 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.
> 
> I'm pretty sure that, as the W3C has adopted sRGB as its standard, your colors
> should be #declared with `srgb` rather than `rgb`.  Your list is consistent with
> mine, and when I render these colors, it seems clear that they are gamma-2.2 or
> sRGB encoded.  Note that the `srgb` keyword will yield consistent colors
> regardless of your assumed_gamma setting.

Verified: https://www.w3.org/TR/SVG11/types.html#DataTypeColor

You should use the `srgb` keyword, not the `rgb` keyword.


Post a reply to this message

From: Ilya Razmanov
Subject: Re: SVG Recognized colors
Date: 27 Mar 2026 23:36:20
Message: <69c74cb4$1@news.povray.org>
On 26.03.2026 16:32, jr wrote:

> super.  one small oversight (sorry :-)), all '#debug' statements need an
> explicit '\n' to "show".

LOL, I was so concentrated on adding "\n" to the ends of my strings that 
completely missed adding "\\n" in the middle.

Anyway, here go finally corrected script, so anyone may change things to 
one's own taste.

-- 
Ilyich the Toad
https://dnyarri.github.io/


Post a reply to this message


Attachments:
Download 'svg_recognized_color_keyword_names.py.txt' (7 KB)

From: kurtz le pirate
Subject: Re: SVG Recognized colors
Date: 28 Mar 2026 05:58:31
Message: <69c7a647$1@news.povray.org>
On 25/03/2026 23:02, Cousin Ricky wrote:

> ...
> Thanks for this.  I toyed around with this idea a few years ago, but I got the
> sense that the list of colors varied from distro to distro, so I put it on
> indefinite hold.  Looking at your source, I wonder if the inconsistencies may
> have been because I was looking at X11 rather than SVG.
> 

X11 ?

 From <https://en.wikipedia.org/wiki/X11_color_names> and a few formulas 
in Excel :

#declare AliceBlue = color red 0.94 green 0.97 blue 1.00;
#declare AntiqueWhite = color red 0.98 green 0.92 blue 0.84;
#declare Aqua = color red 0.00 green 1.00 blue 1.00;
#declare Aquamarine = color red 0.50 green 1.00 blue 0.83;
#declare Azure = color red 0.94 green 1.00 blue 1.00;
#declare Beige = color red 0.96 green 0.96 blue 0.86;
#declare Bisque = color red 1.00 green 0.89 blue 0.77;
#declare Black = color red 0.00 green 0.00 blue 0.00;
#declare BlanchedAlmond = color red 1.00 green 0.92 blue 0.80;
#declare Blue = color red 0.00 green 0.00 blue 1.00;
#declare BlueViolet = color red 0.54 green 0.17 blue 0.89;
#declare Brown = color red 0.65 green 0.16 blue 0.16;
#declare Burlywood = color red 0.87 green 0.72 blue 0.53;
#declare CadetBlue = color red 0.37 green 0.62 blue 0.63;
#declare Chartreuse = color red 0.50 green 1.00 blue 0.00;
#declare Chocolate = color red 0.82 green 0.41 blue 0.12;
#declare Coral = color red 1.00 green 0.50 blue 0.31;
#declare CornflowerBlue = color red 0.39 green 0.58 blue 0.93;
#declare Cornsilk = color red 1.00 green 0.97 blue 0.86;
#declare Crimson = color red 0.86 green 0.08 blue 0.24;
#declare Cyan = color red 0.00 green 1.00 blue 1.00;
#declare DarkBlue = color red 0.00 green 0.00 blue 0.55;
#declare DarkCyan = color red 0.00 green 0.55 blue 0.55;
#declare DarkGoldenrod = color red 0.72 green 0.53 blue 0.04;
#declare DarkGray = color red 0.66 green 0.66 blue 0.66;
#declare DarkGreen = color red 0.00 green 0.39 blue 0.00;
#declare DarkKhaki = color red 0.74 green 0.72 blue 0.42;
#declare DarkMagenta = color red 0.55 green 0.00 blue 0.55;
#declare DarkOliveGreen = color red 0.33 green 0.42 blue 0.18;
#declare DarkOrange = color red 1.00 green 0.55 blue 0.00;
#declare DarkOrchid = color red 0.60 green 0.20 blue 0.80;
#declare DarkRed = color red 0.55 green 0.00 blue 0.00;
#declare DarkSalmon = color red 0.91 green 0.59 blue 0.48;
#declare DarkSeaGreen = color red 0.56 green 0.74 blue 0.56;
#declare DarkSlateBlue = color red 0.28 green 0.24 blue 0.55;
#declare DarkSlateGray = color red 0.18 green 0.31 blue 0.31;
#declare DarkTurquoise = color red 0.00 green 0.81 blue 0.82;
#declare DarkViolet = color red 0.58 green 0.00 blue 0.83;
#declare DeepPink = color red 1.00 green 0.08 blue 0.58;
#declare DeepSkyBlue = color red 0.00 green 0.75 blue 1.00;
#declare DimGray = color red 0.41 green 0.41 blue 0.41;
#declare DodgerBlue = color red 0.12 green 0.56 blue 1.00;
#declare Firebrick = color red 0.70 green 0.13 blue 0.13;
#declare FloralWhite = color red 1.00 green 0.98 blue 0.94;
#declare ForestGreen = color red 0.13 green 0.55 blue 0.13;
#declare Fuchsia = color red 1.00 green 0.00 blue 1.00;
#declare Gainsboro[a] = color red 0.86 green 0.86 blue 0.86;
#declare GhostWhite = color red 0.97 green 0.97 blue 1.00;
#declare Gold = color red 1.00 green 0.84 blue 0.00;
#declare Goldenrod = color red 0.85 green 0.65 blue 0.13;
#declare Gray = color red 0.75 green 0.75 blue 0.75;
#declare WebGray = color red 0.50 green 0.50 blue 0.50;
#declare Green = color red 0.00 green 1.00 blue 0.00;
#declare WebGreen = color red 0.00 green 0.50 blue 0.00;
#declare GreenYellow = color red 0.68 green 1.00 blue 0.18;
#declare Honeydew = color red 0.94 green 1.00 blue 0.94;
#declare HotPink = color red 1.00 green 0.41 blue 0.71;
#declare IndianRed = color red 0.80 green 0.36 blue 0.36;
#declare Indigo = color red 0.29 green 0.00 blue 0.51;
#declare Ivory = color red 1.00 green 1.00 blue 0.94;
#declare Khaki = color red 0.94 green 0.90 blue 0.55;
#declare Lavender = color red 0.90 green 0.90 blue 0.98;
#declare LavenderBlush = color red 1.00 green 0.94 blue 0.96;
#declare LawnGreen = color red 0.49 green 0.99 blue 0.00;
#declare LemonChiffon = color red 1.00 green 0.98 blue 0.80;
#declare LightBlue = color red 0.68 green 0.85 blue 0.90;
#declare LightCoral = color red 0.94 green 0.50 blue 0.50;
#declare LightCyan = color red 0.88 green 1.00 blue 1.00;
#declare LightGoldenrod = color red 0.98 green 0.98 blue 0.82;
#declare LightGray = color red 0.83 green 0.83 blue 0.83;
#declare LightGreen = color red 0.56 green 0.93 blue 0.56;
#declare LightPink = color red 1.00 green 0.71 blue 0.76;
#declare LightSalmon = color red 1.00 green 0.63 blue 0.48;
#declare LightSeaGreen = color red 0.13 green 0.70 blue 0.67;
#declare LightSkyBlue = color red 0.53 green 0.81 blue 0.98;
#declare LightSlateGray = color red 0.47 green 0.53 blue 0.60;
#declare LightSteelBlue = color red 0.69 green 0.77 blue 0.87;
#declare LightYellow = color red 1.00 green 1.00 blue 0.88;
#declare Lime = color red 0.00 green 1.00 blue 0.00;
#declare LimeGreen = color red 0.20 green 0.80 blue 0.20;
#declare Linen = color red 0.98 green 0.94 blue 0.90;
#declare Magenta = color red 1.00 green 0.00 blue 1.00;
#declare Maroon = color red 0.69 green 0.19 blue 0.38;
#declare WebMaroon = color red 0.50 green 0.00 blue 0.00;
#declare MediumAquamarine = color red 0.40 green 0.80 blue 0.67;
#declare MediumBlue = color red 0.00 green 0.00 blue 0.80;
#declare MediumOrchid = color red 0.73 green 0.33 blue 0.83;
#declare MediumPurple = color red 0.58 green 0.44 blue 0.86;
#declare MediumSeaGreen = color red 0.24 green 0.70 blue 0.44;
#declare MediumSlateBlue = color red 0.48 green 0.41 blue 0.93;
#declare MediumSpringGreen = color red 0.00 green 0.98 blue 0.60;
#declare MediumTurquoise = color red 0.28 green 0.82 blue 0.80;
#declare MediumVioletRed = color red 0.78 green 0.08 blue 0.52;
#declare MidnightBlue = color red 0.10 green 0.10 blue 0.44;
#declare MintCream = color red 0.96 green 1.00 blue 0.98;
#declare MistyRose = color red 1.00 green 0.89 blue 0.88;
#declare Moccasin = color red 1.00 green 0.89 blue 0.71;
#declare NavajoWhite = color red 1.00 green 0.87 blue 0.68;
#declare NavyBlue = color red 0.00 green 0.00 blue 0.50;
#declare OldLace = color red 0.99 green 0.96 blue 0.90;
#declare Olive = color red 0.50 green 0.50 blue 0.00;
#declare OliveDrab = color red 0.42 green 0.56 blue 0.14;
#declare Orange = color red 1.00 green 0.65 blue 0.00;
#declare OrangeRed = color red 1.00 green 0.27 blue 0.00;
#declare Orchid = color red 0.85 green 0.44 blue 0.84;
#declare PaleGoldenrod = color red 0.93 green 0.91 blue 0.67;
#declare PaleGreen = color red 0.60 green 0.98 blue 0.60;
#declare PaleTurquoise = color red 0.69 green 0.93 blue 0.93;
#declare PaleVioletRed = color red 0.86 green 0.44 blue 0.58;
#declare PapayaWhip = color red 1.00 green 0.94 blue 0.84;
#declare PeachPuff = color red 1.00 green 0.85 blue 0.73;
#declare Peru = color red 0.80 green 0.52 blue 0.25;
#declare Pink = color red 1.00 green 0.75 blue 0.80;
#declare Plum = color red 0.87 green 0.63 blue 0.87;
#declare PowderBlue = color red 0.69 green 0.88 blue 0.90;
#declare Purple = color red 0.63 green 0.13 blue 0.94;
#declare WebPurple = color red 0.50 green 0.00 blue 0.50;
#declare RebeccaPurple = color red 0.40 green 0.20 blue 0.60;
#declare Red = color red 1.00 green 0.00 blue 0.00;
#declare RosyBrown = color red 0.74 green 0.56 blue 0.56;
#declare RoyalBlue = color red 0.25 green 0.41 blue 0.88;
#declare Saddlebrown = color red 0.55 green 0.27 blue 0.07;
#declare Salmon = color red 0.98 green 0.50 blue 0.45;
#declare SandyBrown = color red 0.96 green 0.64 blue 0.38;
#declare SeaGreen = color red 0.18 green 0.55 blue 0.34;
#declare Seashell = color red 1.00 green 0.96 blue 0.93;
#declare Sienna = color red 0.63 green 0.32 blue 0.18;
#declare Silver = color red 0.75 green 0.75 blue 0.75;
#declare SkyBlue = color red 0.53 green 0.81 blue 0.92;
#declare SlateBlue = color red 0.42 green 0.35 blue 0.80;
#declare SlateGray = color red 0.44 green 0.50 blue 0.56;
#declare Snow = color red 1.00 green 0.98 blue 0.98;
#declare SpringGreen = color red 0.00 green 1.00 blue 0.50;
#declare SteelBlue = color red 0.27 green 0.51 blue 0.71;
#declare Tan = color red 0.82 green 0.71 blue 0.55;
#declare Teal = color red 0.00 green 0.50 blue 0.50;
#declare Thistle = color red 0.85 green 0.75 blue 0.85;
#declare Tomato = color red 1.00 green 0.39 blue 0.28;
#declare Turquoise = color red 0.25 green 0.88 blue 0.82;
#declare Violet = color red 0.93 green 0.51 blue 0.93;
#declare Wheat = color red 0.96 green 0.87 blue 0.70;
#declare White = color red 1.00 green 1.00 blue 1.00;
#declare WhiteSmoke = color red 0.96 green 0.96 blue 0.96;
#declare Yellow = color red 1.00 green 1.00 blue 0.00;
#declare YellowGreen = color red 0.60 green 0.80 blue 0.20;


ps : spaces in color names have been removed



-- 
kurtz le pirate
compagnie de la banquise


Post a reply to this message

From: jr
Subject: Re: SVG Recognized colors
Date: 28 Mar 2026 06:35:00
Message: <web.69c7ae40d157b00d48bf72fa6cde94f1@news.povray.org>
hi,

kurtz le pirate <kur### [at] freefr> wrote:
> On 25/03/2026 23:02, Cousin Ricky wrote:
> > ...
> > Thanks for this.  I toyed around with this idea a few years ago, but I got the
> > sense that the list of colors varied from distro to distro, so I put it on
> > indefinite hold.  Looking at your source, I wonder if the inconsistencies may
> > have been because I was looking at X11 rather than SVG.
>
> X11 ?
>
>  From <https://en.wikipedia.org/wiki/X11_color_names> ...

really ??  why not use the "authoritative" source, '/usr/share/X11/rgb.txt' ?
and you get well over 500 colour names and variations (594 here).


regards, jr.


Post a reply to this message

From: kurtz le pirate
Subject: Re: SVG Recognized colors
Date: 28 Mar 2026 12:52:12
Message: <69c8073c$1@news.povray.org>
On 28/03/2026 11:32, jr wrote:

> 
> really ??  why not use the "authoritative" source, '/usr/share/X11/rgb.txt' ?
> and you get well over 500 colour names and variations (594 here).
> 
> 


Shame on me :(

Here, the new one from /usr/share/X11/rgb.txt



-- 
kurtz le pirate
compagnie de la banquise


Post a reply to this message


Attachments:
Download 'x11_colors.inc.txt' (52 KB)

<<< Previous 3 Messages Goto Latest 10 Messages Next 1 Messages >>>

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.