Holo
January 11, 2021, 11:24am
1
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
Holo
January 11, 2021, 12:42pm
2
seems to return floating numbers too.
jdhill
January 11, 2021, 1:33pm
3
that doesn’t seem possible, how are you calling it?
var lch = ColorRGBA.CreateFromLCH(x);
var argb = (System.Drawing.Color)lch;
Holo
January 11, 2021, 10:28pm
4
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
stevebaer
(Steve Baer)
January 12, 2021, 12:31am
5
RGBA are just numbers in double precision. Multiply each value by 255 and to set up a System,Drawing.Color