mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-02 09:52:27 -04:00
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:
parent
8ba1ae924c
commit
7c676b5d26
@ -19,7 +19,7 @@ def getTkColorString(color):
|
|||||||
Print out a Tk compatible version of a color string
|
Print out a Tk compatible version of a color string
|
||||||
"""
|
"""
|
||||||
def toHex(intVal):
|
def toHex(intVal):
|
||||||
val = int(round(intVal))
|
val = int(intVal)
|
||||||
if val < 16:
|
if val < 16:
|
||||||
return "0" + hex(val)[2:]
|
return "0" + hex(val)[2:]
|
||||||
else:
|
else:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user