LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Automatically generate color

Solved!
Go to solution

I need to create different color codes ( like 10, 20 or even more colors depending on number of parameters). i.e for  n number of parameters i should have n different colors.
At the moment in this example i have only 4 color codes ( 1,0,0;0,1,0;0,0,1;1,0,1)

Is there a way to generate color codes automatically?? Or any other ideas??

Thanks

Nghtcwrlr

---------------------------------------------------------------------------------------------
*************************************
---------------------------------------------------------------------------------------------
Message 1 of 17
(3,541 Views)
Solution
Accepted by topic author Nghtcrwlr
hi i just tried out something. check if it is suitable to you.
Regards
Freelance_LV
TestAutomation Consultant
Message 2 of 17
(3,524 Views)
The problem is not going to be generating the colors, the problem is going to be finding operators that can distinguish between that many similar colors. You would be amazed as to how common color blindness really is.

Some studies put the number as high as 20% of the adult male population have some measurable degree of color blindness- though among women the rate is a couple orders of magnitude lower. There are also variations along racial lines with Asian tending to having the best color vision and Caucasians having the worst.

What is it exactly that you are trying to do?

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
Message 3 of 17
(3,518 Views)

Beside color blindness problems:

You could create your colors using the HSV color model. It's more easy to create different colors using this model instead of the "standard" RGB color model!

 

- You simply need to change hue values (with constant saturation and value)...

- When you need a lot more colors you could also change the saturation to get shades of colors.

 

All information needed is found on Wikipedia...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 4 of 17
(3,514 Views)

Thankyou all for your reply.

Freelance_LV solution is perfect for my application. What i need was just to use these generated colors as legends for a plot.

Ya of course some values for color multiplier in Freelance_LV VI may cause real problem in distingsuishing the colors. I tried to use HSV.But making the saturation and lightness values constant makes it generate just a single color. And I find it difficult to choose a good constant value for both.

Nghtcwrlr

---------------------------------------------------------------------------------------------
*************************************
---------------------------------------------------------------------------------------------
0 Kudos
Message 5 of 17
(3,508 Views)

Hi Nghtcrwlr,

 

good start values for saturation and value are 100% (saturated colors). Then hue just changes the color across the rainbow...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 6 of 17
(3,506 Views)

Do you mean  using HSL bitman like this?

 

But there is no change in color value. See attachment

Nghtcwrlr

---------------------------------------------------------------------------------------------
*************************************
---------------------------------------------------------------------------------------------
0 Kudos
Message 7 of 17
(3,464 Views)

missing subVI...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 8 of 17
(3,462 Views)

sorry. I placed them from function palette.Here are the subvis

Nghtcwrlr

---------------------------------------------------------------------------------------------
*************************************
---------------------------------------------------------------------------------------------
Download All
0 Kudos
Message 9 of 17
(3,454 Views)

Hi Nghtcrwlr,

 

maybe you should change the Hue value in your FOR loop when you want to change colors? As by now you only use static values...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 10 of 17
(3,452 Views)