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

Unified Diff: src/core/SkColor.cpp

Issue 2264643002: Added SkColor4f::FromColor3f(SkColor3f, float a) (Closed) Base URL: https://skia.googlesource.com/skia@master
Patch Set: Removed header include from .cpp file Created 4 years, 4 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
« no previous file with comments | « include/core/SkColor.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkColor.cpp
diff --git a/src/core/SkColor.cpp b/src/core/SkColor.cpp
index 39e9aafa929f0d30a971a40bb10781d8a0d3bf36..6dacc063e0beb73b893f78f8f0e05fa4812790e4 100644
--- a/src/core/SkColor.cpp
+++ b/src/core/SkColor.cpp
@@ -155,6 +155,15 @@ SkColor4f SkColor4f::FromColor(SkColor bgra) {
return rgba;
}
+SkColor4f SkColor4f::FromColor3f(SkColor3f color3f, float a) {
+ SkColor4f rgba;
+ rgba.fR = color3f.fX;
+ rgba.fG = color3f.fY;
+ rgba.fB = color3f.fZ;
+ rgba.fA = a;
+ return rgba;
+}
+
SkColor SkColor4f::toSkColor() const {
return Sk4f_toS32(swizzle_rb(Sk4f::Load(this->vec())));
}
« no previous file with comments | « include/core/SkColor.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698