Skip to content
This repository was archived by the owner on Sep 6, 2021. It is now read-only.

Commit 52642ff

Browse files
committed
Added color names support.
1 parent 5f7bfaa commit 52642ff

2 files changed

Lines changed: 23 additions & 0 deletions

File tree

src/extensions/default/SVGCodeHints/SVGAttributes.json

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,9 @@
4747
"clipPathUnits": {
4848
"attribOptions": ["objectBoundingBox", "userSpaceOnUse"]
4949
},
50+
"color": {
51+
"type": "color"
52+
},
5053
"color-interpolation": {
5154
"attribOptions": ["auto", "inherit", "linearRGB", "sRGB"]
5255
},
@@ -113,6 +116,9 @@
113116
"feTurbulence/type": {
114117
"attribOptions": ["fractalNoise", "turbulence"]
115118
},
119+
"fill": {
120+
"type": "color"
121+
},
116122
"fill-opacity": {
117123
"attribOptions": ["inherit"]
118124
},
@@ -125,6 +131,9 @@
125131
"filterUnits": {
126132
"attribOptions": ["objectBoundingBox", "userSpaceOnUse"]
127133
},
134+
"flood-color": {
135+
"type": "color"
136+
},
128137
"flood-opacity": {
129138
"attribOptions": ["inherit"]
130139
},
@@ -179,6 +188,9 @@
179188
"letter-spacing": {
180189
"attribOptions": ["inherit", "normal"]
181190
},
191+
"lighting-color": {
192+
"type": "color"
193+
},
182194
"marker-end": {
183195
"attribOptions": ["inherit", "none"]
184196
},
@@ -286,9 +298,15 @@
286298
"stitchTiles": {
287299
"attribOptions": ["noStitch", "stitch"]
288300
},
301+
"stop-color": {
302+
"type": "color"
303+
},
289304
"stop-opacity": {
290305
"attribOptions": ["inherit"]
291306
},
307+
"stroke": {
308+
"type": "color"
309+
},
292310
"stroke-dasharray": {
293311
"attribOptions": ["inherit", "none"]
294312
},

src/extensions/default/SVGCodeHints/main.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ define(function (require, exports, module) {
3434
XMLUtils = brackets.getModule("language/XMLUtils"),
3535
StringMatch = brackets.getModule("utils/StringMatch"),
3636
ExtensionUtils = brackets.getModule("utils/ExtensionUtils"),
37+
ColorUtils = brackets.getModule("utils/ColorUtils"),
3738
_ = brackets.getModule("thirdparty/lodash"),
3839
SVGTags = require("text!SVGTags.json"),
3940
SVGAttributes = require("text!SVGAttributes.json"),
@@ -207,6 +208,10 @@ define(function (require, exports, module) {
207208
} else if (attributeData[tagInfo.attrName]) {
208209
options = attributeData[tagInfo.attrName].attribOptions;
209210
isMultiple = attributeData[tagInfo.attrName].multiple;
211+
212+
if (attributeData[tagInfo.attrName].type === "color") {
213+
options = ColorUtils.COLOR_NAMES;
214+
}
210215
}
211216

212217
// Stop if the attribute doesn't support multiple options.

0 commit comments

Comments
 (0)