We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3223dec commit 03ce534Copy full SHA for 03ce534
src/compas_rv/scene/diagramobject.py
@@ -75,14 +75,11 @@ def compute_edge_colors(self, tol=1e-3) -> None:
75
if fmax - fmin < tol:
76
return
77
colors = []
78
- # colormap = ColorMap.from_two_colors(Color.green(), Color.blue())
79
- colormap = ColorMap.from_three_colors(Color.blue(), Color.green(), Color.red())
+
80
for force, magnitude in zip(forces, magnitudes):
81
- if force > 0:
82
- color = colormap(magnitude, minval=fmin, maxval=fmax)
83
- colors.append(color)
84
- else:
85
- colors.append(Color.red())
+ if fmin != fmax:
+ colors.append(Color.from_i((magnitude - fmin) / (fmax - fmin)))
86
return colors
87
88
# =============================================================================
0 commit comments