Add better repr to Color class
Closed this issue · 3 comments
jdegenstein commented
print(Color(*(.3,.5,.6)))
Returns: Color: (0.30000001192092896, 0.5, 0.6000000238418579, 1.0)
Color(*(.3,.5,.6))
Returns: <build123d.geometry.Color at 0x12f6e8eb3d0>
gumyr commented
After 6eb00f1:
>>> str(Color(*(.3,.5,.6)))
'Color: (0.30000001192092896, 0.5, 0.6000000238418579, 1.0) ~ LIGHTBLUE3'
>>> Color(*(.3,.5,.6))
Color(0.30000001192092896, 0.5, 0.6000000238418579, 1.0)
jdegenstein commented
Wow that was fast, thanks!
gumyr commented
The string now returns the closest named color which is a good sanity check that the color is correct.