Re: Problems with TColor()

Rene Brun (Rene.Brun@cern.ch)
Fri, 11 Dec 1998 15:10:16 +0100


Janousch Markus wrote:
>
> Dear Rooters,
>
> It seems that in Root the colors ci=1,..., 50 are already
> defined. Also the corresponding lighter and darker colors ci+100 and
> ci+150 are defined by Root. I want to define my own 50 colors not
> changing the colors predefined by Root. When calling the normal ctor
> for TColor for colors in the range of 51 - 100, which are not
> predefined in Root, the ctor complains, because it tries to create also
> the colors from 151 - 250 which already exist in part. So, the colors
> 51 - 100 cannot be created by a user. Maybe it would be useful to
> change the statement in the ctor
> if (color > 0 && color < 100) { //*-*- Now create associated
> colors for WBOX shading
> to
> if (color > 0 && color < 51) ?
>

Hi Markus,
I have modified the above statement as you propose. You can bypass
this problem in the existing versions in the following way
Create a TColor *myColor = new TColor(300,...
myColor->SetNumber(myNumber);
where 50<myNumber<100

Rene Brun

>
> On the other hand, creating colors beyond 255 seems to be possible,
> but any object drawn with such a high number apears to be white. I am
> not really sure whether this is due to a limitation of the colormap. I
> couldn't plot objects with color numbers beyond 255 on a SparcStation
> 2 and a Linux-PC.
>
> Also, I discovered that colors from 201 - 228 are predefined by
> Root. What are they beeing used for?
>
> So it seems that if I want to create new colors I am stuck with the
> color number 229 - 255 or am I doing something wrong? Any hints are
> most welcome!
>
> Cheers, Markus
>
> --
> markus.janousch@psi.ch