ability to insert uppercase color names

This commit is contained in:
Marek Duława
2014-01-14 15:19:51 +01:00
parent ab486f7e1f
commit 13635e7462

View File

@@ -151,6 +151,8 @@ tree.Color.prototype = {
};
tree.Color.fromKeyword = function(keyword) {
keyword = keyword.toLowerCase();
if (tree.colors.hasOwnProperty(keyword)) {
// detect named color
return new(tree.Color)(tree.colors[keyword].slice(1));