summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--scripts/generate-style-code.js9
1 files changed, 8 insertions, 1 deletions
diff --git a/scripts/generate-style-code.js b/scripts/generate-style-code.js
index 642da1174b..2a25f37112 100644
--- a/scripts/generate-style-code.js
+++ b/scripts/generate-style-code.js
@@ -3,7 +3,14 @@
const fs = require('fs');
const ejs = require('ejs');
const spec = require('mapbox-gl-style-spec').latest;
-var parseCSSColor = require('csscolorparser').parseCSSColor;
+var colorParser = require('csscolorparser');
+
+function parseCSSColor(str) {
+ var color = colorParser.parseCSSColor(str);
+ return [
+ color[0] / 255 * color[3], color[1] / 255 * color[3], color[2] / 255 * color[3], color[3]
+ ];
+}
global.camelize = function (str) {
return str.replace(/(?:^|-)(.)/g, function (_, x) {