[skottie] Fix color parsing
Currently truncating unnecessarily. TBR= Change-Id: I1929a4de62364e4685eb67f9a79b01a8dbac1c61 Reviewed-on: https://skia-review.googlesource.com/133823 Reviewed-by: Florin Malita <fmalita@chromium.org> Commit-Queue: Florin Malita <fmalita@chromium.org>
This commit is contained in:
parent
7999e0dae2
commit
92206a435b
@ -59,10 +59,10 @@ SkColor ValueTraits<VectorValue>::As<SkColor>(const VectorValue& v) {
|
||||
b = v.size() > 2 ? v[2] : 0,
|
||||
a = v.size() > 3 ? v[3] : 1;
|
||||
|
||||
return SkColorSetARGB(SkTPin<SkScalar>(a, 0, 1) * 255,
|
||||
SkTPin<SkScalar>(r, 0, 1) * 255,
|
||||
SkTPin<SkScalar>(g, 0, 1) * 255,
|
||||
SkTPin<SkScalar>(b, 0, 1) * 255);
|
||||
return SkColorSetARGB(SkScalarRoundToInt(SkTPin(a, 0.0f, 1.0f) * 255),
|
||||
SkScalarRoundToInt(SkTPin(r, 0.0f, 1.0f) * 255),
|
||||
SkScalarRoundToInt(SkTPin(g, 0.0f, 1.0f) * 255),
|
||||
SkScalarRoundToInt(SkTPin(b, 0.0f, 1.0f) * 255));
|
||||
}
|
||||
|
||||
template <>
|
||||
|
Loading…
Reference in New Issue
Block a user