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

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

Issue 126033003: Support colors w/ alpha in SVG 'stop' elements and 'feFlood' (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 11 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/platform/graphics/Color.cpp
diff --git a/Source/platform/graphics/Color.cpp b/Source/platform/graphics/Color.cpp
index 97b568a1a9eaf868f60b175dd7ebc29622cb72e0..2399047805b208410a2da297bce2bc33e1667922 100644
--- a/Source/platform/graphics/Color.cpp
+++ b/Source/platform/graphics/Color.cpp
@@ -312,6 +312,11 @@ Color Color::dark() const
alpha());
}
+Color Color::modulate(float factor) const
+{
+ return colorWithOverrideAlpha(rgb(), (alpha() / 255.f) * factor);
+}
+
static int blendComponent(int c, int a)
{
// We use white.

Powered by Google App Engine
This is Rietveld 408576698