Skip to content

Commit 8a58df3

Browse files
committed
use previously defined macros to implement some colormaps
- defining colormaps is now very easy thanks to the flexibility of the provided macros - we can also rely on already existing colors
1 parent 6ff8a93 commit 8a58df3

File tree

1 file changed

+71
-0
lines changed

1 file changed

+71
-0
lines changed

plotters/src/style/colors/colormaps.rs

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,3 +89,74 @@ macro_rules! define_linear_interpolation_color_map{
8989
implement_linear_interpolation_color_map!{$color_scale_name, $color_type}
9090
}
9191
}
92+
93+
94+
define_linear_interpolation_color_map!{
95+
ViridisRGBA,
96+
RGBAColor,
97+
( 68, 1, 84, 1.0),
98+
( 70, 50, 127, 1.0),
99+
( 54, 92, 141, 1.0),
100+
( 39, 127, 143, 1.0),
101+
( 31, 162, 136, 1.0),
102+
( 74, 194, 110, 1.0),
103+
(160, 219, 57, 1.0),
104+
(254, 232, 37, 1.0)
105+
}
106+
107+
108+
define_linear_interpolation_color_map!{
109+
ViridisRGB,
110+
RGBColor,
111+
( 68, 1, 84),
112+
( 70, 50, 127),
113+
( 54, 92, 141),
114+
( 39, 127, 143),
115+
( 31, 162, 136),
116+
( 74, 194, 110),
117+
(160, 219, 57),
118+
(254, 232, 37)
119+
}
120+
121+
122+
define_linear_interpolation_color_map!{
123+
BlackWhite,
124+
RGBColor,
125+
( 0, 0, 0),
126+
(255, 255, 255)
127+
}
128+
129+
130+
define_linear_interpolation_color_map!{
131+
MandelbrotHSL,
132+
HSLColor,
133+
(0.0, 1.0, 0.5),
134+
(1.0, 1.0, 0.5)
135+
}
136+
137+
138+
define_linear_interpolation_color_map!{
139+
VulcanoHSL,
140+
HSLColor,
141+
(2.0/3.0, 1.0, 0.7),
142+
( 0.0, 1.0, 0.7)
143+
}
144+
145+
146+
use super::full_palette::*;
147+
define_linear_interpolation_color_map!{
148+
Bone,
149+
RGBColor,
150+
BLACK,
151+
BLUE,
152+
WHITE
153+
}
154+
155+
156+
define_linear_interpolation_color_map!{
157+
Copper,
158+
RGBColor,
159+
BLACK,
160+
BROWN,
161+
ORANGE
162+
}

0 commit comments

Comments
 (0)