I want to make a color picker like a color wheel so i can get a color output in HEX or RGB. Does anyone have some tips how to create this? I use this to control a RGB led to set it to a color but i have no idea where to start.
Create an image with the color wheel.
Handle mouse events with respect to the point of the color wheel pressed. See example project for how to implement event handlers https://forge.codesys.com/prj/codesys-example/visu-event-hand/home/Home/
Compute the color starting from the coordinates after transforming them as angle/distance from center.
Set the color and move elements accordingly (via absolute movement properties).
Last edit: sgronchi 2022-03-17
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
I want to make a color picker like a color wheel so i can get a color output in HEX or RGB. Does anyone have some tips how to create this? I use this to control a RGB led to set it to a color but i have no idea where to start.
see example picture attached
Create an image with the color wheel.
Handle mouse events with respect to the point of the color wheel pressed. See example project for how to implement event handlers https://forge.codesys.com/prj/codesys-example/visu-event-hand/home/Home/
Compute the color starting from the coordinates after transforming them as angle/distance from center.
Set the color and move elements accordingly (via absolute movement properties).
Last edit: sgronchi 2022-03-17