Create a Color Picker

sequenszer
2022-03-15
2022-03-17
  • sequenszer - 2022-03-15

    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

     
  • sgronchi - 2022-03-17

    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

Log in to post a comment.