From 7c676b5d26621c8aa20e45f65efd6e104090ef68 Mon Sep 17 00:00:00 2001 From: rdb Date: Sat, 19 Dec 2020 15:26:32 +0100 Subject: [PATCH] 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. --- direct/src/directtools/DirectUtil.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/direct/src/directtools/DirectUtil.py b/direct/src/directtools/DirectUtil.py index 2a244e325c..43d46831cb 100644 --- a/direct/src/directtools/DirectUtil.py +++ b/direct/src/directtools/DirectUtil.py @@ -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: