Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1041)

Unified Diff: Source/core/platform/graphics/Color.cpp

Issue 14098003: Change the caret color according to the lightness of the background color. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: updated patch Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/core/platform/graphics/Color.cpp
diff --git a/Source/core/platform/graphics/Color.cpp b/Source/core/platform/graphics/Color.cpp
index c6bdeb25cdf5afa5f9bd920d10fa0de997b963a3..53b4c115134e714c642643f8bd0d1b7514272beb 100644
--- a/Source/core/platform/graphics/Color.cpp
+++ b/Source/core/platform/graphics/Color.cpp
@@ -414,6 +414,14 @@ void Color::getHSL(double& hue, double& saturation, double& lightness) const
saturation = ((max - min) / (2.0 - (max + min)));
}
+double Color::lightness() const
+{
+ double hue, saturation, lightness;
+ getHSL(hue, saturation, lightness);
+
+ return lightness;
+}
+
Color colorFromPremultipliedARGB(RGBA32 pixelColor)
{
int alpha = alphaChannel(pixelColor);
« Source/core/editing/FrameSelection.cpp ('K') | « Source/core/platform/graphics/Color.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698