diff --git a/src/ol/color/color.js b/src/ol/color/color.js index f50c852634..79fee12f56 100644 --- a/src/ol/color/color.js +++ b/src/ol/color/color.js @@ -13,6 +13,14 @@ goog.require('goog.math'); goog.require('goog.vec.Mat4'); +/** + * @define {boolean} Enable named colors. + * Enabling named colors adds about 3KB uncompressed / 1.5KB compressed to the + * final build size. + */ +ol.color.ENABLE_NAMED_COLORS = true; + + /** * A color represented as a short array [red, green, blue, alpha]. * red, green, and blue should be integers in the range 0..255 inclusive. @@ -153,7 +161,7 @@ ol.color.fromString = (function() { ol.color.fromStringInternal_ = function(s) { var isHex = false; - if (goog.color.names.hasOwnProperty(s)) { + if (ol.color.ENABLE_NAMED_COLORS && goog.color.names.hasOwnProperty(s)) { s = goog.color.names[s]; isHex = true; } diff --git a/src/ol/render/dragbox.js b/src/ol/render/dragbox.js index e2fe12bd8a..90791ff619 100644 --- a/src/ol/render/dragbox.js +++ b/src/ol/render/dragbox.js @@ -51,7 +51,7 @@ ol.render.DragBox = function(opt_style) { }, image: null, stroke: { - color: 'red', + color: '#ff0000', width: 1 }, zIndex: 0 diff --git a/src/ol/style.js b/src/ol/style.js index 7d996417b3..101946b000 100644 --- a/src/ol/style.js +++ b/src/ol/style.js @@ -124,7 +124,7 @@ ol.style.DEFAULT_IMAGE_STYLE = { * @type {ol.style.Stroke} */ ol.style.DEFAULT_STROKE_STYLE = { - color: 'red', + color: '#ff0000', width: 3 };