controlp5
controlp5 copied to clipboard
ColorWheel set functions don't actually update the current picked color
Functions ColorWheel.setHue, setLightness, setSaturation adjust the internal hsl model, but there's no way to actually update the actual internal color picked, so none of those functions will actually change the currently picked color until there is a mouse event on the color picker.
Go the same problem .. I want to sync the ColorWheel value with the mqtt-values of a rgb-light.
Currently my approach is this but it is not working as expected.
Scanner scanner = new Scanner(sPayload);
scanner.useLocale(Locale.US);
try
{
float h = scanner.nextFloat();
float s = scanner.nextFloat();
float v = scanner.nextFloat();
float h_norm = h/360.0;
float s_norm = s/100.0;
float v_norm = v/100.0;
System.out.format("h = %f | s = %f | v = %f (normalized)\r\n",h_norm,s_norm,v_norm);
cp5.get(ColorWheel.class,"c").setHSL(h_norm,s_norm,v_norm);
No update in 2 years? Is scontrolp5 dead?