Planning to use this for the ColorDisplay widget in https://codereview.chromium.org/
2259183003/
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=
2264643002
Review-Url: https://codereview.chromium.org/
2264643002
#define SkColor_DEFINED
#include "SkScalar.h"
+#include "SkPoint3.h"
#include "SkTypes.h"
/** \file SkColor.h
static SkColor4f Pin(float r, float g, float b, float a);
static SkColor4f FromColor(SkColor);
+ static SkColor4f FromColor3f(SkColor3f, float a);
SkColor toSkColor() const;
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())));
}