Login  Register

Re: Color Names

Posted by Herbie on Apr 29, 2019; 5:54pm
URL: http://imagej.273.s1.nabble.com/Color-Names-tp5022138p5022146.html

Thank you Wayne,

for the prompt addition of the three colors to the named ones.

Highly appreciated!

Best

Herbie

:::::::::::::::::::::::::::::::::::::::::::
Am 29.04.19 um 18:37 schrieb Wayne Rasband:

>
>> On Apr 28, 2019, at 7:26 AM, Herbie <[hidden email]> wrote:
>>
>> Dear listers and dear Wayne,
>>
>> an inspection of the source code at
>>
>> <https://imagej.nih.gov/ij/source/ij/plugin/Colors.java>
>>
>> confirmed my experience that the following color names, e.g. as listed in the comment to the macro function "setColor(string)", are no longer supported by ImageJ:
>>
>> "darkGray"
>> "lightGray"
>> “pink"
>
> The ImageJ 1.52p6 daily build adds support for these three colors. The following example macro displays all 13 named colors.
>
> -wayne
>
>    colors = newArray("black", "blue", "cyan", "darkGray",
>       "gray", "green", "lightGray", "magenta", "orange",
>       "pink", "red", "white", "yellow");
>    width = 300;
>    height = 400;
>    n = colors.length;
>    x = 15;
>    y = 15;
>    w = 0.9*width;
>    h = height/n;
>    inc = height/(n+1);
>    newImage("Colors", "RGB black", width, height, 1);
>    run("Add...", "value=90");
>    setFont("SanSerif", 16, "bold antialiased")
>    for (i=0; i<n; i++) {
>       setColor(colors[i]);
>       fillRect(x, y, w, h);
>       setColor("white");
>       drawString(colors[i], x+5, y+20);
>       y += inc;
>    }
>
>
>
>
>>
>> So, could someone please correct the list of allowed color names
>>
>> <https://imagej.nih.gov/ij/developer/macro/functions.html>
>>
>> and perhaps in other place where these names are wrongly listed.
>>
>> Many thanks
>>
>> Herbie
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html