mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-12 05:49:03 +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)
|
||||
def prettier_color(l):
|
||||
maximum = max(l[:3])
|
||||
# color_list is a list of 4 elements: [r, g, b, a], each element is a float 0..1
|
||||
def prettier_color(color_list):
|
||||
maximum = max(color_list[:3])
|
||||
if maximum > 0:
|
||||
factor = min(1 / maximum, 2.5)
|
||||
else:
|
||||
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.
|
||||
|
Loading…
x
Reference in New Issue
Block a user