How to assign Color to EVE Box corresponding to a float value

Hello Rooters,
The question is related to below link

My problem is that i wanted to give color to eve box corresponding to a float value.
like i wanted to give different color for 0.46 and 0.48

I was able to give color by scaling up the value and converting it to interger, but was not able to
assign color based on the float value itself.

Is it possible to do that in EVE, or is there any alternative to that.

Hi,

Sorry, I don’t get. You are looking for a direct way to pass float to an eve element and set the color through it? This doesn’t exist … you’ll either have to map them yourself, use TColor::GetColorPalette() as shown in the post you reference, or use TEveRGBAPalette which is sort of a wrapper around it (it has an option to interpolate between palette values). TEveDigitSet / QuadSet / BoxSet can work with the EveRGBAPalette directly, allowing you to fiddle with active range and cuts through GUI. See eve/tutorial/boxset.C.

Cheers,
Matevz

Thanks a lot matevz,
I will try that again, and will also try to use TEveRGBPalette.

Using TColor, i am able to get something which is close to i want.
Thanks for that.

Is it possible to also display the correspond color bar along with colored boxes so that one can easily see which color corresponds to lower value and which corresponds to higher value.

TEveRGBAPalette can be shown with an axis in the gl viewer, you add it as an overlay element and can be moved around the screen.