Fix opacity in createFromString

This commit is contained in:
Tom Payne
2013-08-13 16:14:58 +02:00
parent 7b95509970
commit 362ace01da

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);
};