Merge pull request #902 from twpayne/fix-color

Fix opacity in createFromString
This commit is contained in:
Tom Payne
2013-08-14 05:29:09 -07:00

View File

@@ -44,7 +44,7 @@ ol.Color = function(r, g, b, a) {
*/
ol.Color.createFromString = function(str, opt_a) {
var rgb = goog.color.hexToRgb(goog.color.parse(str).hex);
var a = opt_a || 255;
var a = goog.isDef(opt_a) ? opt_a : 1;
return new ol.Color(rgb[0], rgb[1], rgb[2], a);
};