Skip to content

Commit 1e1339e

Browse files
committed
vpr: Add support for many more block colours
1 parent 8372cc7 commit 1e1339e

File tree

1 file changed

+150
-4
lines changed

1 file changed

+150
-4
lines changed

vpr/src/draw/draw.cpp

Lines changed: 150 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,12 @@ constexpr float SB_EDGE_STRAIGHT_ARROW_POSITION = 0.95;
6363

6464
constexpr float EMPTY_BLOCK_LIGHTEN_FACTOR = 0.10;
6565

66-
//Kelly's maximum contrast colors (Kenneth Kelly, "Twenty-Two Colors of Maximum Contrast", Color Eng. 3(6), 1943)
67-
const std::array<t_color,21> kelly_max_contrast_colors = {
68-
//t_color(242, 243, 244), //white: skip white since it doesn't contrast well with the light background
66+
//Kelly's maximum contrast colors are selected to be easily distinguishable as described in:
67+
// Kenneth Kelly, "Twenty-Two Colors of Maximum Contrast", Color Eng. 3(6), 1943
68+
//We use these to highlight a relatively small number of things (e.g. stages in a critical path,
69+
//a subset of selected net) where it is important for them to be visually distinct.
70+
const std::vector<t_color> kelly_max_contrast_colors = {
71+
//t_color(242, 243, 244), //white: skip white since it doesn't contrast well with VPR's light background
6972
t_color( 34, 34, 34), //black
7073
t_color(243, 195, 0), //yellow
7174
t_color(135, 86, 146), //purple
@@ -89,8 +92,12 @@ const std::array<t_color,21> kelly_max_contrast_colors = {
8992
t_color( 43, 61, 38) //olive green
9093
};
9194

95+
//The colours used to draw block types
9296
const std::vector<color_types> block_type_colors = {
93-
BISQUE,
97+
//This first set of colours is somewhat curated to yield
98+
//a nice colour pallette
99+
BISQUE, //EMPTY type is usually the type with index 0, so this colour
100+
//usually unused
94101
LIGHTGREY,
95102
LIGHTSKYBLUE,
96103
THISTLE,
@@ -105,6 +112,145 @@ const std::vector<color_types> block_type_colors = {
105112
FIREBRICK,
106113
LIMEGREEN,
107114
PLUM,
115+
116+
//However, if we have lots of block types we just assign arbitrary HTML
117+
//colours. Note that these are shuffled (instead of in alphabetical order)
118+
//since some colours which are alphabetically close are also close in
119+
//shade (making them difficult to distinguish)
120+
DARKGREEN,
121+
PALEVIOLETRED,
122+
BLUE,
123+
FORESTGREEN,
124+
WHEAT,
125+
GOLD,
126+
MOCCASIN,
127+
MEDIUMORCHID,
128+
SKYBLUE,
129+
WHITESMOKE,
130+
LIME,
131+
MEDIUMSLATEBLUE,
132+
TOMATO,
133+
CYAN,
134+
OLIVE,
135+
LIGHTGRAY,
136+
STEELBLUE,
137+
LIGHTCORAL,
138+
IVORY,
139+
MEDIUMVIOLETRED,
140+
SNOW,
141+
DARKGRAY,
142+
GREY,
143+
GRAY,
144+
YELLOW,
145+
REBECCAPURPLE,
146+
DARKCYAN,
147+
MIDNIGHTBLUE,
148+
ROSYBROWN,
149+
CORNSILK,
150+
NAVAJOWHITE,
151+
BLANCHEDALMOND,
152+
ORCHID,
153+
LIGHTGOLDENRODYELLOW,
154+
MAROON,
155+
GREENYELLOW,
156+
SILVER,
157+
PALEGOLDENROD,
158+
LAWNGREEN,
159+
DIMGREY,
160+
DARKVIOLET,
161+
DARKTURQUOISE,
162+
INDIGO,
163+
DARKORANGE,
164+
PAPAYAWHIP,
165+
MINTCREAM,
166+
GREEN,
167+
DARKMAGENTA,
168+
MAGENTA,
169+
LIGHTSLATEGRAY,
170+
CHARTREUSE,
171+
GHOSTWHITE,
172+
LIGHTCYAN,
173+
SIENNA,
174+
GOLDENROD,
175+
DARKSLATEGRAY,
176+
OLDLACE,
177+
SEASHELL,
178+
SPRINGGREEN,
179+
MEDIUMTURQUOISE,
180+
LEMONCHIFFON,
181+
MISTYROSE,
182+
OLIVEDRAB,
183+
LIGHTBLUE,
184+
CHOCOLATE,
185+
SEAGREEN,
186+
DEEPPINK,
187+
LIGHTSEAGREEN,
188+
FLORALWHITE,
189+
CADETBLUE,
190+
AZURE,
191+
BURLYWOOD,
192+
AQUAMARINE,
193+
BROWN,
194+
POWDERBLUE,
195+
HOTPINK,
196+
MEDIUMBLUE,
197+
BLUEVIOLET,
198+
GREY75,
199+
PURPLE,
200+
TEAL,
201+
ANTIQUEWHITE,
202+
DEEPSKYBLUE,
203+
SLATEGRAY,
204+
SALMON,
205+
SLATEBLUE,
206+
DARKORCHID,
207+
LIGHTPINK,
208+
DARKBLUE,
209+
PEACHPUFF,
210+
PALEGREEN,
211+
DARKSALMON,
212+
DARKOLIVEGREEN,
213+
DARKSEAGREEN,
214+
VIOLET,
215+
RED,
216+
DARKSLATEGREY,
217+
PALETURQUOISE,
218+
DARKRED,
219+
SLATEGREY,
220+
HONEYDEW,
221+
AQUA,
222+
LIGHTSTEELBLUE,
223+
DODGERBLUE,
224+
MEDIUMSPRINGGREEN,
225+
NAVY,
226+
GAINSBORO,
227+
LIGHTYELLOW,
228+
CRIMSON,
229+
FUCHSIA,
230+
DARKGOLDENROD,
231+
SANDYBROWN,
232+
BEIGE,
233+
LINEN,
234+
ORANGERED,
235+
ROYALBLUE,
236+
LAVENDER,
237+
TAN,
238+
YELLOWGREEN,
239+
CORNFLOWERBLUE,
240+
LAVENDERBLUSH,
241+
MEDIUMSEAGREEN,
242+
PINK,
243+
GREY55,
244+
PERU,
245+
LIGHTGREEN,
246+
LIGHTSALMON,
247+
INDIANRED,
248+
DIMGRAY,
249+
LIGHTSLATEGREY,
250+
MEDIUMAQUAMARINE,
251+
DARKGREY,
252+
ORANGE,
253+
ALICEBLUE,
108254
};
109255

110256
/************************** File Scope Variables ****************************/

0 commit comments

Comments
 (0)