Skip to content

Commit

Permalink
short colors added
Browse files Browse the repository at this point in the history
  • Loading branch information
apsavin committed Jan 10, 2012
1 parent 1902e4e commit 175f076
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions privateFunctions/private.js
Original file line number Diff line number Diff line change
Expand Up @@ -306,9 +306,17 @@ function parseColor(color)
}
if(color.charAt(0)=='#')
{
colorKeeper.r=parseInt(color.substr(1,2),16);
colorKeeper.g=parseInt(color.substr(3,2),16);
colorKeeper.b=parseInt(color.substr(5,2),16);
if (color.length > 4) {
colorKeeper.r = parseInt(color.substr(1, 2), 16);
colorKeeper.g = parseInt(color.substr(3, 2), 16);
colorKeeper.b = parseInt(color.substr(5, 2), 16);
}
else {
var r = color.charAt(1), g = color.charAt(2), b = color.charAt(3);
colorKeeper.r = parseInt(r + r, 16);
colorKeeper.g = parseInt(g + g, 16);
colorKeeper.b = parseInt(b + b, 16);
}
}
else
{
Expand Down

0 comments on commit 175f076

Please sign in to comment.