joBr99 / nspanel-lovelace-ui

Custom Firmware for NsPanel with the design of HomeAssistant's lovelace UI in mind, works with Tasmota.
GNU General Public License v3.0
854 stars 187 forks source link

Color Wheel RGB values wrong #1196

Closed b-tronic closed 3 months ago

b-tronic commented 3 months ago

PROBLEM DESCRIPTION

A clear and concise description of what the problem is. When you choose a color with the colorwheel, the created RGB values are wrong. Blue is always 160, even when you touch deep red.

REQUESTED INFORMATION

Make sure your have performed every step and checked the applicable boxes before submitting your issue. Thank you!

- [ ] Go to Settings>Add-ons>AppDaemon>Log (or the output of your TS script) and then, provide the output of the log during your issue/bug occurs:

Log output here:



### TO REPRODUCE
_Steps to reproduce the behavior:_

### EXPECTED BEHAVIOUR
_A clear and concise description of what you expected to happen._

### SCREENSHOTS
_If applicable, add screenshots/pictures to help explain your problem._

### ADDITIONAL CONTEXT
_Add any other context about the problem here._
_Please note here in case you are using ioBroker_

### PANEL / FIRMWARE VERSION
_Please add the Panel/Firmware Version you are using (EU, US-L or US-P)_
joBr99 commented 3 months ago

Do you mean the values that are retuned by the panel on the serial protocol? Those values are not RGB - it's the position you are touching the image on the panel.

160 is the width/height of the image

You need to convert them to RGB:

https://github.com/joBr99/nspanel-lovelace-ui/blob/19050079d4168d9c9d23e4e7ea0d1cc5d8de9ca3/apps/nspanel-lovelace-ui/luibackend/helper.py#L15