fix: convert system colors to device color space in systemPreferences (#28121)
This commit is contained in:
parent
a442f11574
commit
f73256651b
3 changed files with 18 additions and 3 deletions
|
@ -51,4 +51,14 @@ std::string ToRGBHex(SkColor color) {
|
|||
SkColorGetG(color), SkColorGetB(color));
|
||||
}
|
||||
|
||||
std::string ToRGBAHex(SkColor color, bool include_hash) {
|
||||
std::string color_str = base::StringPrintf(
|
||||
"%02X%02X%02X%02X", SkColorGetR(color), SkColorGetG(color),
|
||||
SkColorGetB(color), SkColorGetA(color));
|
||||
if (include_hash) {
|
||||
return "#" + color_str;
|
||||
}
|
||||
return color_str;
|
||||
}
|
||||
|
||||
} // namespace electron
|
||||
|
|
|
@ -17,6 +17,8 @@ SkColor ParseHexColor(const std::string& color_string);
|
|||
// Convert color to RGB hex value like "#ABCDEF"
|
||||
std::string ToRGBHex(SkColor color);
|
||||
|
||||
std::string ToRGBAHex(SkColor color, bool include_hash = true);
|
||||
|
||||
} // namespace electron
|
||||
|
||||
#endif // SHELL_COMMON_COLOR_UTIL_H_
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue