CARVIEW |
Navigation Menu
-
Notifications
You must be signed in to change notification settings - Fork 7.6k
Put an array of all the color names in ColorUtils #10303
Conversation
I like this method better than stuffing them in the regex, but I'll need to check what changes I need to make to the Inline Color Editor to use this. 👍 |
* Sorted array of all the color names in the CSS Color Module Level 3 (https://www.w3.org/TR/css3-color/) | ||
* @const @type {Array} | ||
*/ | ||
var COLOR_NAMES = ["aliceblue", "antiquewhite", "aqua", "aquamarine", "azure", "beige", "bisque", "black", "blanchedalmond", "blue", "blueviolet", "brown", "burlywood", "cadetblue", "chartreuse", "chocolate", "coral", "cornflowerblue", "cornsilk", "crimson", "cyan", "darkblue", "darkcyan", "darkgoldenrod", "darkgray", "darkgreen", "darkgrey", "darkkhaki", "darkmagenta", "darkolivegreen", "darkorange", "darkorchid", "darkred", "darksalmon", "darkseagreen", "darkslateblue", "darkslategray", "darkslategrey", "darkturquoise", "darkviolet", "deeppink", "deepskyblue", "dimgray", "dimgrey", "dodgerblue", "firebrick", "floralwhite", "forestgreen", "fuchsia", "gainsboro", "ghostwhite", "gold", "goldenrod", "gray", "green", "greenyellow", "grey", "honeydew", "hotpink", "indianred", "indigo", "ivory", "khaki", "lavender", "lavenderblush", "lawngreen", "lemonchiffon", "lightblue", "lightcoral", "lightcyan", "lightgoldenrodyellow", "lightgray", "lightgreen", "lightgrey", "lightpink", "lightsalmon", "lightseagreen", "lightskyblue", "lightslategray", "lightslategrey", "lightsteelblue", "lightyellow", "lime", "limegreen", "linen", "magenta", "maroon", "mediumaquamarine", "mediumblue", "mediumorchid", "mediumpurple", "mediumseagreen", "mediumslateblue", "mediumspringgreen", "mediumturquoise", "mediumvioletred", "midnightblue", "mintcream", "mistyrose", "moccasin", "navajowhite", "navy", "oldlace", "olive", "olivedrab", "orange", "orangered", "orchid", "palegoldenrod", "palegreen", "paleturquoise", "palevioletred", "papayawhip", "peachpuff", "peru", "pink", "plum", "powderblue", "purple", "red", "rosybrown", "royalblue", "saddlebrown", "salmon", "sandybrown", "seagreen", "seashell", "sienna", "silver", "skyblue", "slateblue", "slategray", "slategrey", "snow", "springgreen", "steelblue", "tan", "teal", "thistle", "tomato", "turquoise", "violet", "wheat", "white", "whitesmoke", "yellow", "yellowgreen"]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just in case this is accepted, can you go ahead and add rebeccapurple
to this array (#10250)?
They are still in the regex, so you don't have to change anything. |
This looks good. I agree that |
@redmunds I will close #10252 in favor of this. @marcelgerber Whoops, missed that. GitHub's long single-line diffs are hard for me to read. |
I think we need #9596 first for rebeccapurple to work properly, right? |
Added support for Sooner or later, we should, of course, merge #9596 for full support. |
@marcelgerber I am going to try to finish up #9596 today. |
@redmunds While you're online, can you look into merging this too so we can finish up |
@@ -32,13 +32,23 @@ define(function (require, exports, module) { | |||
"use strict"; | |||
|
|||
/** | |||
* Sorted array of all the color names in the CSS Color Module Level 3 (https://www.w3.org/TR/css3-color/) | |||
* and "rebeccapurple" from CSS Color Module Level 4 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor nit, does not totally need fixing: I'd reword this to
Sorted array of all the color names in the CSS Color Module Level 3 and 4 (https://www.w3.org/TR/css3-color/).
I don't think we need to specifically state what color(s) from CSS4 is supported, as ideally we'd support all of them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think Module Level 4 is ready yet, while Level 3 is.
While it's still in development, we should state which names are available.
Looks good. Merging. |
Put an array of all the color names in ColorUtils
So we (and extension developers) can reuse them whereever we want.
The actual regex is unchanged, it's just getting generated now.