Commit 36de6d6a authored by Leonard Grey's avatar Leonard Grey Committed by Commit Bot

Mac: Take alpha channel into account when reading system colors in Blink

Bug: 898278
Change-Id: I24ae7ef4e8accd54244dfd09721fa376dadfba34
Reviewed-on: https://chromium-review.googlesource.com/c/1305498Reviewed-by: default avatarChristian Biesinger <cbiesinger@chromium.org>
Commit-Queue: Leonard Grey <lgrey@chromium.org>
Cr-Commit-Position: refs/heads/master@{#604111}
parent ef3fa573
......@@ -267,10 +267,11 @@ static RGBA32 ConvertNSColorToColor(NSColor* color) {
NSColor* color_in_color_space = ColorInColorSpace(color);
if (color_in_color_space) {
static const double kScaleFactor = nextafter(256.0, 0.0);
return MakeRGB(
return MakeRGBA(
static_cast<int>(kScaleFactor * [color_in_color_space redComponent]),
static_cast<int>(kScaleFactor * [color_in_color_space greenComponent]),
static_cast<int>(kScaleFactor * [color_in_color_space blueComponent]));
static_cast<int>(kScaleFactor * [color_in_color_space blueComponent]),
static_cast<int>(kScaleFactor * [color_in_color_space alphaComponent]));
}
// This conversion above can fail if the NSColor in question is an
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment