mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-12 22:19:00 +08:00
Better readability in PreviewPass
This commit is contained in:
parent
1551560a6b
commit
06ec77e012
@ -19,13 +19,14 @@ if MYPY:
|
|||||||
|
|
||||||
|
|
||||||
# Make color brighter by normalizing it (maximum factor 2.5 brighter)
|
# Make color brighter by normalizing it (maximum factor 2.5 brighter)
|
||||||
def prettier_color(l):
|
# color_list is a list of 4 elements: [r, g, b, a], each element is a float 0..1
|
||||||
maximum = max(l[:3])
|
def prettier_color(color_list):
|
||||||
|
maximum = max(color_list[:3])
|
||||||
if maximum > 0:
|
if maximum > 0:
|
||||||
factor = min(1 / maximum, 2.5)
|
factor = min(1 / maximum, 2.5)
|
||||||
else:
|
else:
|
||||||
factor = 1.0
|
factor = 1.0
|
||||||
return [min(i * factor, 1.0) for i in l]
|
return [min(i * factor, 1.0) for i in color_list]
|
||||||
|
|
||||||
|
|
||||||
## A render pass subclass that renders slicable objects with default parameters.
|
## A render pass subclass that renders slicable objects with default parameters.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user