From cbdbfb00ca68c1a98011fc3dd272fbc97fff6f89 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Sun, 26 Jan 2020 12:07:59 +0100 Subject: [PATCH] doc: Document named color constants Busywork but it's good for our completion rate :) --- core/color_names.inc | 2 +- doc/classes/Color.xml | 148 ++++++++++++++++++++- modules/gdscript/doc_classes/@GDScript.xml | 5 +- 3 files changed, 150 insertions(+), 5 deletions(-) diff --git a/core/color_names.inc b/core/color_names.inc index b0ef507d92e..428a8473fe6 100644 --- a/core/color_names.inc +++ b/core/color_names.inc @@ -1,4 +1,4 @@ -// Names from https://en.wikipedia.org/wiki/List_of_colors (through https://raw.githubusercontent.com/SuperUserNameMan/color_to_name/616a7cddafefda91478b7bc26167de97fb5badb1/godot_version.gd), slightly edited and normalized +// Names from https://en.wikipedia.org/wiki/X11_color_names #include "core/map.h" static Map _named_colors; diff --git a/doc/classes/Color.xml b/doc/classes/Color.xml index 8820cb5c273..aa6ae188257 100644 --- a/doc/classes/Color.xml +++ b/doc/classes/Color.xml @@ -5,7 +5,7 @@ A color is represented by red, green, and blue [code](r, g, b)[/code] components. Additionally, [code]a[/code] represents the alpha component, often used for transparency. Values are in floating-point and usually range from 0 to 1. Some properties (such as [member CanvasItem.modulate]) may accept values greater than 1. - You can also create a color from standardized color names by using [method @GDScript.ColorN]. + You can also create a color from standardized color names by using [method @GDScript.ColorN] or directly using the color constants defined here. The standardized color set is based on the [url=https://en.wikipedia.org/wiki/X11_color_names]X11 color names[/url]. @@ -308,296 +308,442 @@ + Gray color. + Alice blue color. + Antique white color. + Aqua color. + Aquamarine color. + Azure color. + Beige color. + Bisque color. + Black color. + Blanche almond color. + Blue color. + Blue violet color. + Brown color. + Burly wood color. + Cadet blue color. + Chartreuse color. + Chocolate color. + Coral color. + Cornflower color. + Corn silk color. + Crimson color. + Cyan color. + Dark blue color. + Dark cyan color. + Dark goldenrod color. + Dark gray color. + Dark green color. + Dark khaki color. + Dark magenta color. + Dark olive green color. + Dark orange color. + Dark orchid color. + Dark red color. + Dark salmon color. + Dark sea green color. + Dark slate blue color. + Dark slate gray color. + Dark turquoise color. + Dark violet color. + Deep pink color. + Deep sky blue color. + Dim gray color. + Dodger blue color. + Firebrick color. + Floral white color. + Forest green color. + Fuchsia color. + Gainsboro color. + Ghost white color. + Gold color. + Goldenrod color. + Green color. + Green yellow color. + Honeydew color. + Hot pink color. + Indian red color. + Indigo color. + Ivory color. + Khaki color. + Lavender color. + Lavender blush color. + Lawn green color. + Lemon chiffon color. + Light blue color. + Light coral color. + Light cyan color. + Light goldenrod color. + Light gray color. + Light green color. + Light pink color. + Light salmon color. + Light sea green color. + Light sky blue color. + Light slate gray color. + Light steel blue color. + Light yellow color. + Lime color. + Lime green color. + Linen color. + Magenta color. + Maroon color. + Medium aquamarine color. + Medium blue color. + Medium orchid color. + Medium purple color. + Medium sea green color. + Medium slate blue color. + Medium spring green color. + Medium turquoise color. + Medium violet red color. + Midnight blue color. + Mint cream color. + Misty rose color. + Moccasin color. + Navajo white color. + Navy blue color. + Old lace color. + Olive color. + Olive drab color. + Orange color. + Orange red color. + Orchid color. + Pale goldenrod color. + Pale green color. + Pale turquoise color. + Pale violet red color. + Papaya whip color. + Peach puff color. + Peru color. + Pink color. + Plum color. + Powder blue color. + Purple color. + Rebecca purple color. + Red color. + Rosy brown color. + Royal blue color. + Saddle brown color. + Salmon color. + Sandy brown color. + Sea green color. + Seashell color. + Sienna color. + Silver color. + Sky blue color. + Slate blue color. + Slate gray color. + Snow color. + Spring green color. + Steel blue color. + Tan color. + Teal color. + Thistle color. + Tomato color. + Transparent color (white with no alpha). + Turquoise color. + Violet color. + Web gray color. + Web green color. + Web maroon color. + Web purple color. + Wheat color. + White color. + White smoke color. + Yellow color. + Yellow green color. diff --git a/modules/gdscript/doc_classes/@GDScript.xml b/modules/gdscript/doc_classes/@GDScript.xml index c4b7e4887ea..e4f86d233d7 100644 --- a/modules/gdscript/doc_classes/@GDScript.xml +++ b/modules/gdscript/doc_classes/@GDScript.xml @@ -39,12 +39,11 @@ - Returns a color according to the standardised [code]name[/code] with [code]alpha[/code] ranging from 0 to 1. + Returns a color according to the standardized [code]name[/code] with [code]alpha[/code] ranging from 0 to 1. [codeblock] red = ColorN("red", 1) [/codeblock] - Supported color names: - "aliceblue", "antiquewhite", "aqua", "aquamarine", "azure", "beige", "bisque", "black", "blanchedalmond", "blue", "blueviolet", "brown", "burlywood", "cadetblue", "chartreuse", "chocolate", "coral", "cornflower", "cornsilk", "crimson", "cyan", "darkblue", "darkcyan", "darkgoldenrod", "darkgray", "darkgreen", "darkkhaki", "darkmagenta", "darkolivegreen", "darkorange", "darkorchid", "darkred", "darksalmon", "darkseagreen", "darkslateblue", "darkslategray", "darkturquoise", "darkviolet", "deeppink", "deepskyblue", "dimgray", "dodgerblue", "firebrick", "floralwhite", "forestgreen", "fuchsia", "gainsboro", "ghostwhite", "gold", "goldenrod", "gray", "webgray", "green", "webgreen", "greenyellow", "honeydew", "hotpink", "indianred", "indigo", "ivory", "khaki", "lavender", "lavenderblush", "lawngreen", "lemonchiffon", "lightblue", "lightcoral", "lightcyan", "lightgoldenrod", "lightgray", "lightgreen", "lightpink", "lightsalmon", "lightseagreen", "lightskyblue", "lightslategray", "lightsteelblue", "lightyellow", "lime", "limegreen", "linen", "magenta", "maroon", "webmaroon", "mediumaquamarine", "mediumblue", "mediumorchid", "mediumpurple", "mediumseagreen", "mediumslateblue", "mediumspringgreen", "mediumturquoise", "mediumvioletred", "midnightblue", "mintcream", "mistyrose", "moccasin", "navajowhite", "navyblue", "oldlace", "olive", "olivedrab", "orange", "orangered", "orchid", "palegoldenrod", "palegreen", "paleturquoise", "palevioletred", "papayawhip", "peachpuff", "peru", "pink", "plum", "powderblue", "purple", "webpurple", "rebeccapurple", "red", "rosybrown", "royalblue", "saddlebrown", "salmon", "sandybrown", "seagreen", "seashell", "sienna", "silver", "skyblue", "slateblue", "slategray", "snow", "springgreen", "steelblue", "tan", "teal", "thistle", "tomato", "turquoise", "violet", "wheat", "white", "whitesmoke", "yellow", "yellowgreen". + Supported color names are the same as the constants defined in [Color].