Support for IE's ARGB syntax (#aarrggbb)

This commit is contained in:
Miles
2011-04-24 12:43:17 -07:00
parent ffb75c27c0
commit 104fc91a81

View File

@@ -15,6 +15,11 @@ tree.Color = function (rgb, a) {
this.rgb = rgb.match(/.{2}/g).map(function (c) {
return parseInt(c, 16);
});
} else if (rgb.length == 8) {
this.alpha = parseInt(rgb.substring(0,2), 16) / 255.0;
this.rgb = rgb.substr(2).match(/.{2}/g).map(function (c) {
return parseInt(c, 16);
});
} else {
this.rgb = rgb.split('').map(function (c) {
return parseInt(c + c, 16);