Error in colors.xml?

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
Post Reply
el_supremo
Posts: 1015
Joined: 2005-03-21T21:16:57-07:00

Error in colors.xml?

Post by el_supremo »

In IM 6.4.1 Q8 there are two definitions of "green" in colors.xml. The first, which is what MagickWand seems to use, is rgb(0,128,0) and the second is rgb(0,255,0).
Each of the other colours, red, blue, magenta, yellow, cyan, black and white is defined only once at the beginning of the file and they are all defined as "full scale" - e.g.red is rgb(255,0,0).

Is this an error?

Pete
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Error in colors.xml?

Post by magick »

There are two versions of green because they follow two different standards: X11 and SVG. Which one is used is determines by the standards compliance passed to the query color method.
el_supremo
Posts: 1015
Joined: 2005-03-21T21:16:57-07:00

Re: Error in colors.xml?

Post by el_supremo »

As far as I can see from the source, there's no way to specify compliance in MagickCore or MagickWand.
In MagickWand, when setting a colour name with PixelSetColor(p_wand,"green"), it calls QueryMagickColor which, in the case of a named colour, calls GetColorInfo. GetColorInfo searches the color_list (loaded from colors.xml?) and returns the first match to the name without regard to compliance. So, in the case of MagickWand code there seems to be no compliance at all. I can't find a MagickCore function which returns colour intensities given a colour name and compliance.

This is just FYI. It's not a panic for me, I'm just messing around.

Pete
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: Error in colors.xml?

Post by anthony »

Simple soluion "green" is SVG green "lime" is X11 green

I use lime for green in IM Examples all the time!
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Post Reply