directtools: Fix incorrect rounding for color conversion to hex

The color picker returns color values up to 255.99 so this can otherwise result in it returning a color like #100100100, and the hex code otherwise not matching with what is displayed in the color picker.
This commit is contained in:
rdb 2020-12-19 15:26:32 +01:00
parent 8ba1ae924c
commit 7c676b5d26

View File

@ -19,7 +19,7 @@ def getTkColorString(color):
Print out a Tk compatible version of a color string
"""
def toHex(intVal):
val = int(round(intVal))
val = int(intVal)
if val < 16:
return "0" + hex(val)[2:]
else: