mirror of
https://github.com/panda3d/panda3d.git
synced 2025-09-30 00:32:57 -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
|
||||
"""
|
||||
def toHex(intVal):
|
||||
val = int(round(intVal))
|
||||
val = int(intVal)
|
||||
if val < 16:
|
||||
return "0" + hex(val)[2:]
|
||||
else:
|
||||
|
Loading…
x
Reference in New Issue
Block a user