aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/core/SkColor.h
diff options
context:
space:
mode:
authorGravatar brianosman <brianosman@google.com>2016-06-24 06:31:47 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-06-24 06:31:47 -0700
commite074d1fa6ace83dd77971b971c07166bedeb28ef (patch)
treeffdbdc9ce69615ca7923b4816343d01fddad7bac /include/core/SkColor.h
parent7bde5659d354b4ef227c487a4e9fa8de12573c31 (diff)
Change SkColor4f to RGBA channel order
Diffstat (limited to 'include/core/SkColor.h')
-rw-r--r--include/core/SkColor.h12
1 files changed, 7 insertions, 5 deletions
diff --git a/include/core/SkColor.h b/include/core/SkColor.h
index a40e5f1f15..e473db486a 100644
--- a/include/core/SkColor.h
+++ b/include/core/SkColor.h
@@ -166,10 +166,10 @@ struct SkPM4f;
* The float values are 0...1 unpremultiplied
*/
struct SkColor4f {
- float fA;
float fR;
float fG;
float fB;
+ float fA;
bool operator==(const SkColor4f& other) const {
return fA == other.fA && fR == other.fR && fG == other.fG && fB == other.fB;
@@ -178,14 +178,16 @@ struct SkColor4f {
return !(*this == other);
}
- const float* vec() const { return &fA; }
- float* vec() { return &fA; }
+ const float* vec() const { return &fR; }
+ float* vec() { return &fR; }
- static SkColor4f Pin(float a, float r, float g, float b);
+ static SkColor4f Pin(float r, float g, float b, float a);
static SkColor4f FromColor(SkColor);
+ SkColor toSkColor() const;
+
SkColor4f pin() const {
- return Pin(fA, fR, fG, fB);
+ return Pin(fR, fG, fB, fA);
}
SkPM4f premul() const;