aseprite / aseprite

Animated sprite editor & pixel art tool (Windows, macOS, Linux)
https://www.aseprite.org
28.36k stars 5.5k forks source link

color conversion from hex to hue is always off by 1 #3044

Open Omar-Abdul-Azeez opened 2 years ago

Omar-Abdul-Azeez commented 2 years ago

watch the gif first before reading forward:

bugu

as you can see I set 105 in the hue value which set 40ff00 as the hex -> this is correct, 40ff00 is indeed a hue value of 105 then I closed the color change ui (changing to a different color mode is enough) opening the color changing ui back again and looking at the hsv/hsl values now the hue value is off by 1 -> the hex is still 40ff00 which is 105 so the color I'm drawing with is actually 105 and not 104 as shown in the ui

now onto the edge cases:

  1. setting hue to 0 doesn't end up shown as -1 it still shows as 0
  2. setting hue to 360 seems to end up as 0 so I figured aseprite changes 360 to 0
  3. which led me to test 359 and it stays the same so I figured there's a point where this bug doesn't occur?
  4. 350 -> 349 but 351 -> 351

tested on 1.3beta6 and 1.29

Gasparoken commented 2 years ago

Hi Omar-Abdul-Aziz, thanks for this report. I checked and yes, it isn't consistent. We'll to fix this soon. Possibly related to https://github.com/aseprite/aseprite/issues/2245

gallickgunner commented 2 years ago

Hi Omar-Abdul-Aziz, thanks for this report. I checked and yes, it isn't consistent. We'll to fix this soon. Possibly related to #2245

Just encountered this as well. Honestly I was scratching my head for an hour or so till I realized the color wasn't changing at all it's just the display values. Perhaps you can store HSV/HSL values separately just for showing them in the GUI so that end-users don't get confused and do the conversion to RGB behind the scenes?