Skip to content

Commit 37836b2

Browse files
committed
Constantify everything related to color maps
1 parent 02a7ed5 commit 37836b2

File tree

5 files changed

+937
-463
lines changed

5 files changed

+937
-463
lines changed

ast.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1466,18 +1466,18 @@ namespace Sass {
14661466
double a = cap_channel<1> (a_);
14671467

14681468
// get color from given name (if one was given at all)
1469-
if (name != "" && names_to_colors.count(name)) {
1470-
Color* n = names_to_colors.find(name)->second;
1469+
if (name != "" && name_to_color(name)) {
1470+
const Color* n = name_to_color(name);
14711471
r = round(cap_channel<0xff>(n->r()));
14721472
g = round(cap_channel<0xff>(n->g()));
14731473
b = round(cap_channel<0xff>(n->b()));
14741474
a = cap_channel<1> (n->a());
14751475
}
14761476
// otherwise get the possible resolved color name
14771477
else {
1478-
int numval = static_cast<int>(r) * 0x10000 + static_cast<int>(g) * 0x100 + static_cast<int>(b);
1479-
if (colors_to_names.count(numval))
1480-
res_name = colors_to_names.find(numval)->second;
1478+
int numval = r * 0x10000 + g * 0x100 + b;
1479+
if (color_to_name(numval))
1480+
res_name = color_to_name(numval);
14811481
}
14821482

14831483
stringstream hexlet;

0 commit comments

Comments
 (0)