POV-Ray : Newsgroups : povray.general : SVG Recognized colors : Re: SVG Recognized colors Server Time
28 Mar 2026 13:06:13 EDT (-0400)
  Re: SVG Recognized colors  
From: Cousin Ricky
Date: 25 Mar 2026 18:05:00
Message: <web.69c45b7ed157b00d60e0cc3d949c357d@news.povray.org>
Ilya Razmanov <ily### [at] gmailcom> wrote:
> [snip]
>
> 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.

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.

> 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.


Post a reply to this message

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