Browse Source

Fix color premultiplication from hex.

Former-commit-id: 86b4b8b7e31772ab500e1e640aedfdc3132e09f0
Former-commit-id: 868f44324cca75204e66f99e8b874a911fcfa2bd
Former-commit-id: 219524794f8882fc11341f35cf6d947937b4abb8
pull/1/head
James Jackson-South 10 years ago
parent
commit
ae5d6f0c75
  1. 3
      src/ImageProcessorCore/Colors/Color.cs

3
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)

Loading…
Cancel
Save