From ae5d6f0c75b878ea871cfbcaee5e9faec0b0134c Mon Sep 17 00:00:00 2001 From: James Jackson-South Date: Thu, 4 Feb 2016 17:09:35 +1100 Subject: [PATCH] Fix color premultiplication from hex. Former-commit-id: 86b4b8b7e31772ab500e1e640aedfdc3132e09f0 Former-commit-id: 868f44324cca75204e66f99e8b874a911fcfa2bd Former-commit-id: 219524794f8882fc11341f35cf6d947937b4abb8 --- src/ImageProcessorCore/Colors/Color.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/ImageProcessorCore/Colors/Color.cs b/src/ImageProcessorCore/Colors/Color.cs index 36cb548fb..a33ee7c82 100644 --- a/src/ImageProcessorCore/Colors/Color.cs +++ b/src/ImageProcessorCore/Colors/Color.cs @@ -84,7 +84,8 @@ namespace ImageProcessorCore float a = Convert.ToByte(hex.Substring(0, 2), 16); // Do division of Vector4 instead of each component to utilize SIMD optimizations - this.backingVector = FromNonPremultiplied(new Vector4(r, g, b, a) / 255f, this.A); + this.backingVector = new Vector4(r, g, b, a) / 255f; + this.backingVector = FromNonPremultiplied(this.backingVector, this.A); } else if (hex.Length == 6)