summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Core
diff options
context:
space:
mode:
authorStephane Delcroix <stephane@delcroix.org>2017-05-03 08:50:27 (GMT)
committerStephane Delcroix <stephane@delcroix.org>2017-05-05 07:49:04 (GMT)
commitf1e7463fa8e3f84a67456cd494a67a240e7f8aab (patch)
tree7bc4eb88d59f3d887518c39fb4c698ca62d98ca7 /Xamarin.Forms.Core
parentc186b088eb6ddeb4306e028f9a1179b0ca4e4fa1 (diff)
downloadxamarin-forms-f1e7463fa8e3f84a67456cd494a67a240e7f8aab.zip
xamarin-forms-f1e7463fa8e3f84a67456cd494a67a240e7f8aab.tar.gz
xamarin-forms-f1e7463fa8e3f84a67456cd494a67a240e7f8aab.tar.bz2
[C] use the FromRgb[a] overload taking ints, not doubles
Diffstat (limited to 'Xamarin.Forms.Core')
-rw-r--r--Xamarin.Forms.Core/Color.cs18
1 files changed, 9 insertions, 9 deletions
diff --git a/Xamarin.Forms.Core/Color.cs b/Xamarin.Forms.Core/Color.cs
index 605fb9f..2339eb6 100644
--- a/Xamarin.Forms.Core/Color.cs
+++ b/Xamarin.Forms.Core/Color.cs
@@ -332,26 +332,26 @@ namespace Xamarin.Forms
var t2 = ToHexD (hex [idx++]);
var t3 = ToHexD (hex [idx]);
- return FromRgb (t1, t2, t3);
+ return FromRgb ((int)t1, (int)t2, (int)t3);
case 4: //#argb => aarrggbb
var f1 = ToHexD (hex [idx++]);
var f2 = ToHexD (hex [idx++]);
var f3 = ToHexD (hex [idx++]);
var f4 = ToHexD (hex [idx]);
- return FromRgba (f2, f3, f4, f1);
+ return FromRgba ((int)f2, (int)f3, (int)f4, (int)f1);
case 6: //#rrggbb => ffrrggbb
- return FromRgb (ToHex (hex [idx++]) << 4 | ToHex (hex [idx++]),
- ToHex (hex [idx++]) << 4 | ToHex (hex [idx++]),
- ToHex (hex [idx++]) << 4 | ToHex (hex [idx]));
+ return FromRgb ((int)(ToHex (hex [idx++]) << 4 | ToHex (hex [idx++])),
+ (int)(ToHex (hex [idx++]) << 4 | ToHex (hex [idx++])),
+ (int)(ToHex (hex [idx++]) << 4 | ToHex (hex [idx])));
case 8: //#aarrggbb
var a1 = ToHex (hex [idx++]) << 4 | ToHex (hex [idx++]);
- return FromRgba (ToHex (hex [idx++]) << 4 | ToHex (hex [idx++]),
- ToHex (hex [idx++]) << 4 | ToHex (hex [idx++]),
- ToHex (hex [idx++]) << 4 | ToHex (hex [idx]),
- a1);
+ return FromRgba ((int)(ToHex (hex [idx++]) << 4 | ToHex (hex [idx++])),
+ (int)(ToHex (hex [idx++]) << 4 | ToHex (hex [idx++])),
+ (int)(ToHex (hex [idx++]) << 4 | ToHex (hex [idx])),
+ (int)a1);
default: //everything else will result in unexpected results
return Default;