FastLEDHub icon indicating copy to clipboard operation
FastLEDHub copied to clipboard

add setColor

Open thijstriemstra opened this issue 1 year ago • 4 comments

thijstriemstra avatar Apr 11 '24 13:04 thijstriemstra

Hi @thijstriemstra, could you please motivate this change a bit? I think the new color picker value should be broadcasted to active websocket connections so that the web ui is in sync with the actual color value.

srwi avatar Apr 11 '24 18:04 srwi

I have a project with 16 predefined colors and a button that allows you to cycle through them. I use setColor to change the color when the button is pressed and a broadcastMessagethat sends a currentColor and on the client the color is changed. Without this change I would have to add 16 color pickers (all named Color? not sure if it's even possible), making the UI very confusing for the end user. Now one color picker controls the LED overall color (and using the button sets the colorpicker as well).

I can keep the code submitted in this PR in a separate CustomColorclass or something but just thought this might be a simple enhancement. Feel free to close it.

thijstriemstra avatar Apr 11 '24 18:04 thijstriemstra

If I understand correctly you added some more code to your project to broadcast the changed color to active clients. I really like that and would appreciate if you could add that functionality to this PR so that the new feature is more complete.

srwi avatar Apr 12 '24 21:04 srwi

I really like that and would appreciate if you could add that functionality

I do have that code somewhere, no problem. I'll mark this as draft till I find it.

thijstriemstra avatar Jul 28 '24 21:07 thijstriemstra