code reviews
This commit is contained in:
@@ -125,7 +125,7 @@ namespace nana
|
||||
if ((endpos - pos != 4) && (endpos - pos != 7))
|
||||
throw std::invalid_argument(excpt_what);
|
||||
|
||||
auto n = ::nana::stoi(css_color.substr(pos + 1, endpos - pos - 1), nullptr, 16);
|
||||
auto n = std::stoi(css_color.substr(pos + 1, endpos - pos - 1), nullptr, 16);
|
||||
|
||||
if (endpos - pos == 4)
|
||||
{
|
||||
@@ -301,24 +301,24 @@ namespace nana
|
||||
|
||||
if (is_real)
|
||||
{
|
||||
auto pr = ::nana::stod(rgb[0].substr(0, rgb[0].size() - 1));
|
||||
auto pr = std::stod(rgb[0].substr(0, rgb[0].size() - 1));
|
||||
r_ = (pr > 100 ? 255.0 : 2.55 * pr);
|
||||
|
||||
pr = ::nana::stod(rgb[1].substr(0, rgb[1].size() - 1));
|
||||
pr = std::stod(rgb[1].substr(0, rgb[1].size() - 1));
|
||||
g_ = (pr > 100 ? 255.0 : 2.55 * pr);
|
||||
|
||||
pr = ::nana::stod(rgb[2].substr(0, rgb[2].size() - 1));
|
||||
pr = std::stod(rgb[2].substr(0, rgb[2].size() - 1));
|
||||
b_ = (pr > 100 ? 255.0 : 2.55 * pr);
|
||||
}
|
||||
else
|
||||
{
|
||||
r_ = ::nana::stod(rgb[0]);
|
||||
r_ = std::stod(rgb[0]);
|
||||
if (r_ > 255.0) r_ = 255;
|
||||
|
||||
g_ = ::nana::stod(rgb[1]);
|
||||
g_ = std::stod(rgb[1]);
|
||||
if (g_ > 255.0) g_ = 255;
|
||||
|
||||
b_ = ::nana::stod(rgb[2]);
|
||||
b_ = std::stod(rgb[2]);
|
||||
if (b_ > 255.0) b_ = 255;
|
||||
}
|
||||
}
|
||||
@@ -327,7 +327,7 @@ namespace nana
|
||||
if (str.back() == '%')
|
||||
throw std::invalid_argument(excpt_what);
|
||||
|
||||
auto h = ::nana::stod(str);
|
||||
auto h = std::stod(str);
|
||||
|
||||
pos = css_color.find_first_not_of(' ', pos);
|
||||
if (pos == css_color.npos || css_color[pos] != ',')
|
||||
@@ -337,7 +337,7 @@ namespace nana
|
||||
if (str.empty() || str.back() != '%')
|
||||
throw std::invalid_argument(excpt_what);
|
||||
|
||||
auto s = ::nana::stod(str.substr(0, str.size() - 1));
|
||||
auto s = std::stod(str.substr(0, str.size() - 1));
|
||||
|
||||
pos = css_color.find_first_not_of(' ', pos);
|
||||
if (pos == css_color.npos || css_color[pos] != ',')
|
||||
@@ -347,7 +347,7 @@ namespace nana
|
||||
if (str.empty() || str.back() != '%')
|
||||
throw std::invalid_argument(excpt_what);
|
||||
|
||||
auto l = ::nana::stod(str.substr(0, str.size() - 1));
|
||||
auto l = std::stod(str.substr(0, str.size() - 1));
|
||||
|
||||
from_hsl(h, s / 100, l / 100);
|
||||
}
|
||||
@@ -360,7 +360,7 @@ namespace nana
|
||||
if (str.empty() || str.back() == '%')
|
||||
throw std::invalid_argument(excpt_what); //invalid alpha value
|
||||
|
||||
a_ = ::nana::stod(str);
|
||||
a_ = std::stod(str);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user