OoMrFlibble / oolite-debug-console-flibble-mad-alpha

0 stars 1 forks source link

Setting colours is broken #8

Closed OoMrFlibble closed 3 weeks ago

OoMrFlibble commented 3 weeks ago

Using command-background as example.

Changing the numbers left of the sliders, does not affect the 'Selection' until return is pressed from any of the three. The opposite applies too.

Set the colour in 'Selection' to #323232, then hitting return so the RGB fields all read 50. Ok it. Re-open command-background, it shows #303030. Just hitting ok breaks the values. No need to save or quit.. #000000 works ok. #020202 or #030303 come back as zeros. #040404 comes back as #030303

OoMrFlibble commented 3 weeks ago

I tried changing the value in the config file from a named colour like "gray3" to numeric #010101. That loaded correctly. Changing the colour from there put up a similar fight. The colour was then saved, stored by name.

OoMrFlibble commented 3 weeks ago

con.COLOR_TOLERANCE is defined in constants as 8 , and it's used in debugGUI/colors.py:sameColor, where it gets changed to 3 for some things. This will always return a 'close' tkinter color name.

That routine is ALWAYS selecting the nearest colour name. I've brutally reaped it. Now it'll save a name if it's exact, else a number. The config will stick now.