Q: Rhino.Display.ColorRGBA.CreateFromLCH() returns floating values, how convert to ARGB?

Hi guys, I am making a color marmonizer in v7 and see that ColorRGBA.CreateFromLCH() returns floating values, how do I convert that to ARGB?

I found that HSL colors has a .ToArgbColor() function, but RGBA doesn’t, are there any tricks I can use?

Cheers


seems to return floating numbers too.

that doesn’t seem possible, how are you calling it?

var lch = ColorRGBA.CreateFromLCH(x);
var argb = (System.Drawing.Color)lch;

I tried by first converting to HLS, but I gave up the quest.
So I continued with HLS for now and this is examples of the autogenerations I get with todays version: I pick the color in the middle of each, and then the six other colors are generated with changes in Hue, L and S.

This are to help us faster make prettier 2D drawings.
(most of these were made with the same L value since I did them quickly)

1 Like

RGBA are just numbers in double precision. Multiply each value by 255 and to set up a System,Drawing.Color