aboutsummaryrefslogtreecommitdiffhomepage
path: root/modules
diff options
context:
space:
mode:
authorGravatar Florin Malita <fmalita@chromium.org>2018-06-10 17:10:58 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-06-10 21:34:13 +0000
commit92206a435baac1688c148f19e072c49c2f6ea7ab (patch)
tree2839c139b2781cbe353cb28738eca99ccba419a4 /modules
parent7999e0dae25e5e11c18fdd07e59bde485c17f005 (diff)
[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>
Diffstat (limited to 'modules')
-rw-r--r--modules/skottie/src/SkottieValue.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/modules/skottie/src/SkottieValue.cpp b/modules/skottie/src/SkottieValue.cpp
index edfa891aa1..a5fa8d5f34 100644
--- a/modules/skottie/src/SkottieValue.cpp
+++ b/modules/skottie/src/SkottieValue.cpp
@@ -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 <>