summaryrefslogtreecommitdiff
path: root/scripts/generate-style-code.js
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/generate-style-code.js')
-rw-r--r--scripts/generate-style-code.js16
1 files changed, 15 insertions, 1 deletions
diff --git a/scripts/generate-style-code.js b/scripts/generate-style-code.js
index 2a25f37112..4c5f148a00 100644
--- a/scripts/generate-style-code.js
+++ b/scripts/generate-style-code.js
@@ -58,6 +58,10 @@ global.defaultValue = function (property) {
return 1;
}
+ if (property.name === 'fill-outline-color') {
+ return '{}';
+ }
+
switch (property.type) {
case 'number':
return property.default;
@@ -70,7 +74,17 @@ global.defaultValue = function (property) {
return `${propertyType(property)}::${camelize(property.default)}`;
}
case 'color':
- return `{ ${parseCSSColor(property.default).join(', ')} }`
+ var color = parseCSSColor(property.default).join(', ');
+ switch (color) {
+ case '0, 0, 0, 0':
+ return '{}';
+ case '0, 0, 0, 1':
+ return 'Color::black()';
+ case '1, 1, 1, 1':
+ return 'Color::white()';
+ default:
+ return `{ ${color} }`;
+ }
case 'array':
const defaults = (property.default || []).map((e) => defaultValue({ type: property.value, default: e }));
if (property.length) {