How to use HSV rather than RGB to change colors in UI using blocks

I am trying to change the color of the lights of the LED using a phone app. I can do it with RGB too but HSV provides an easier way to control color and brightness. Can anyone help?

http://www.kourbatov.com/faq/rgb2hsv.htm
has the algorithm in Javascript, which would require techniques like in

if you have an appetite for that.

There are conversion blocks in the Color pallete to set and get RGB parts.

Wow that's a mouthful, well, thanks for your reply.

You could also just translate the Javascript code into blocks, using a procedure, local variables, and math blocks.

I got it!!! Thanks for the help. Anyone who needs it here is the code--

2 Likes

Thank you for sharing the procedure!

This looks like a source that should be shared, without retyping.
Could you post the .aia source or a draggable version?

Please download and post each of those event block(s)/procedures here ...
(sample video)

hsv2rgb.aia (4.7 KB)

2 Likes