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()))); |
} |