| 1 | <?xml version="1.0" encoding="UTF-8" ?> |
| 2 | <class name="Color" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> |
| 3 | <brief_description> |
| 4 | A color represented in RGBA format. |
| 5 | </brief_description> |
| 6 | <description> |
| 7 | A color represented in RGBA format by a red ([member r]), green ([member g]), blue ([member b]), and alpha ([member a]) component. Each component is a 32-bit floating-point value, usually ranging from [code]0.0[/code] to [code]1.0[/code]. Some properties (such as [member CanvasItem.modulate]) may support values greater than [code]1.0[/code], for overbright or HDR (High Dynamic Range) colors. |
| 8 | Colors can be created in a number of ways: By the various [Color] constructors, by static methods such as [method from_hsv], and by using a name from the set of standardized colors based on [url=https://en.wikipedia.org/wiki/X11_color_names]X11 color names[/url] with the addition of [constant TRANSPARENT]. |
| 9 | [url=https://raw.githubusercontent.com/godotengine/godot-docs/master/img/color_constants.png]Color constants cheatsheet[/url] |
| 10 | Although [Color] may be used to store values of any encoding, the red ([member r]), green ([member g]), and blue ([member b]) properties of [Color] are expected by Godot to be encoded using the [url=https://en.wikipedia.org/wiki/SRGB#Transfer_function_(%22gamma%22)]nonlinear sRGB transfer function[/url] unless otherwise stated. This color encoding is used by many traditional art and web tools, making it easy to match colors between Godot and these tools. Godot uses [url=https://en.wikipedia.org/wiki/Rec._709]Rec. ITU-R BT.709[/url] color primaries, which are used by the sRGB standard. |
| 11 | All physical simulation, such as lighting calculations, and colorimetry transformations, such as [method get_luminance], must be performed on linearly encoded values to produce correct results. When performing these calculations, convert [Color] to and from linear encoding using [method srgb_to_linear] and [method linear_to_srgb]. |
| 12 | [b]Note:[/b] In a boolean context, a Color will evaluate to [code]false[/code] if it is equal to [code]Color(0, 0, 0, 1)[/code] (opaque black). Otherwise, a Color will always evaluate to [code]true[/code]. |
| 13 | </description> |
| 14 | <tutorials> |
| 15 | <link title="2D GD Paint Demo">https://godotengine.org/asset-library/asset/2768</link> |
| 16 | <link title="Tween Interpolation Demo">https://godotengine.org/asset-library/asset/2733</link> |
| 17 | <link title="GUI Drag And Drop Demo">https://godotengine.org/asset-library/asset/2767</link> |
| 18 | </tutorials> |
| 19 | <constructors> |
| 20 | <constructor name="Color"> |
| 21 | <return type="Color" /> |
| 22 | <description> |
| 23 | Constructs a default [Color] from opaque black. This is the same as [constant BLACK]. |
| 24 | [b]Note:[/b] In C#, this constructs a [Color] with all of its components set to [code]0.0[/code] (transparent black). |
| 25 | </description> |
| 26 | </constructor> |
| 27 | <constructor name="Color"> |
| 28 | <return type="Color" /> |
| 29 | <param index="0" name="from" type="Color" /> |
| 30 | <param index="1" name="alpha" type="float" /> |
| 31 | <description> |
| 32 | Constructs a [Color] from the existing color, with [member a] set to the given [param alpha] value. |
| 33 | [codeblocks] |
| 34 | [gdscript] |
| 35 | var red = Color(Color.RED, 0.2) # 20% opaque red. |
| 36 | [/gdscript] |
| 37 | [csharp] |
| 38 | var red = new Color(Colors.Red, 0.2f); // 20% opaque red. |
| 39 | [/csharp] |
| 40 | [/codeblocks] |
| 41 | </description> |
| 42 | </constructor> |
| 43 | <constructor name="Color"> |
| 44 | <return type="Color" /> |
| 45 | <param index="0" name="from" type="Color" /> |
| 46 | <description> |
| 47 | Constructs a [Color] as a copy of the given [Color]. |
| 48 | </description> |
| 49 | </constructor> |
| 50 | <constructor name="Color"> |
| 51 | <return type="Color" /> |
| 52 | <param index="0" name="code" type="String" /> |
| 53 | <description> |
| 54 | Constructs a [Color] either from an HTML color code or from a standardized color name. The supported color names are the same as the constants. |
| 55 | </description> |
| 56 | </constructor> |
| 57 | <constructor name="Color"> |
| 58 | <return type="Color" /> |
| 59 | <param index="0" name="code" type="String" /> |
| 60 | <param index="1" name="alpha" type="float" /> |
| 61 | <description> |
| 62 | Constructs a [Color] either from an HTML color code or from a standardized color name, with [param alpha] on the range of 0.0 to 1.0. The supported color names are the same as the constants. |
| 63 | </description> |
| 64 | </constructor> |
| 65 | <constructor name="Color"> |
| 66 | <return type="Color" /> |
| 67 | <param index="0" name="r" type="float" /> |
| 68 | <param index="1" name="g" type="float" /> |
| 69 | <param index="2" name="b" type="float" /> |
| 70 | <description> |
| 71 | Constructs a [Color] from RGB values, typically between 0.0 and 1.0. [member a] is set to 1.0. |
| 72 | [codeblocks] |
| 73 | [gdscript] |
| 74 | var color = Color(0.2, 1.0, 0.7) # Similar to `Color.from_rgba8(51, 255, 178, 255)` |
| 75 | [/gdscript] |
| 76 | [csharp] |
| 77 | var color = new Color(0.2f, 1.0f, 0.7f); // Similar to `Color.Color8(51, 255, 178, 255)` |
| 78 | [/csharp] |
| 79 | [/codeblocks] |
| 80 | </description> |
| 81 | </constructor> |
| 82 | <constructor name="Color"> |
| 83 | <return type="Color" /> |
| 84 | <param index="0" name="r" type="float" /> |
| 85 | <param index="1" name="g" type="float" /> |
| 86 | <param index="2" name="b" type="float" /> |
| 87 | <param index="3" name="a" type="float" /> |
| 88 | <description> |
| 89 | Constructs a [Color] from RGBA values, typically between 0.0 and 1.0. |
| 90 | [codeblocks] |
| 91 | [gdscript] |
| 92 | var color = Color(0.2, 1.0, 0.7, 0.8) # Similar to `Color.from_rgba8(51, 255, 178, 204)` |
| 93 | [/gdscript] |
| 94 | [csharp] |
| 95 | var color = new Color(0.2f, 1.0f, 0.7f, 0.8f); // Similar to `Color.Color8(51, 255, 178, 255, 204)` |
| 96 | [/csharp] |
| 97 | [/codeblocks] |
| 98 | </description> |
| 99 | </constructor> |
| 100 | </constructors> |
| 101 | <methods> |
| 102 | <method name="blend" qualifiers="const"> |
| 103 | <return type="Color" /> |
| 104 | <param index="0" name="over" type="Color" /> |
| 105 | <description> |
| 106 | Returns a new color resulting from overlaying this color over the given color. In a painting program, you can imagine it as the [param over] color painted over this color (including alpha). |
| 107 | [codeblocks] |
| 108 | [gdscript] |
| 109 | var bg = Color(0.0, 1.0, 0.0, 0.5) # Green with alpha of 50% |
| 110 | var fg = Color(1.0, 0.0, 0.0, 0.5) # Red with alpha of 50% |
| 111 | var blended_color = bg.blend(fg) # Brown with alpha of 75% |
| 112 | [/gdscript] |
| 113 | [csharp] |
| 114 | var bg = new Color(0.0f, 1.0f, 0.0f, 0.5f); // Green with alpha of 50% |
| 115 | var fg = new Color(1.0f, 0.0f, 0.0f, 0.5f); // Red with alpha of 50% |
| 116 | Color blendedColor = bg.Blend(fg); // Brown with alpha of 75% |
| 117 | [/csharp] |
| 118 | [/codeblocks] |
| 119 | </description> |
| 120 | </method> |
| 121 | <method name="clamp" qualifiers="const"> |
| 122 | <return type="Color" /> |
| 123 | <param index="0" name="min" type="Color" default="Color(0, 0, 0, 0)" /> |
| 124 | <param index="1" name="max" type="Color" default="Color(1, 1, 1, 1)" /> |
| 125 | <description> |
| 126 | Returns a new color with all components clamped between the components of [param min] and [param max], by running [method @GlobalScope.clamp] on each component. |
| 127 | </description> |
| 128 | </method> |
| 129 | <method name="darkened" qualifiers="const"> |
| 130 | <return type="Color" /> |
| 131 | <param index="0" name="amount" type="float" /> |
| 132 | <description> |
| 133 | Returns a new color resulting from making this color darker by the specified [param amount] (ratio from 0.0 to 1.0). See also [method lightened]. |
| 134 | [codeblocks] |
| 135 | [gdscript] |
| 136 | var green = Color(0.0, 1.0, 0.0) |
| 137 | var darkgreen = green.darkened(0.2) # 20% darker than regular green |
| 138 | [/gdscript] |
| 139 | [csharp] |
| 140 | var green = new Color(0.0f, 1.0f, 0.0f); |
| 141 | Color darkgreen = green.Darkened(0.2f); // 20% darker than regular green |
| 142 | [/csharp] |
| 143 | [/codeblocks] |
| 144 | </description> |
| 145 | </method> |
| 146 | <method name="from_hsv" qualifiers="static"> |
| 147 | <return type="Color" /> |
| 148 | <param index="0" name="h" type="float" /> |
| 149 | <param index="1" name="s" type="float" /> |
| 150 | <param index="2" name="v" type="float" /> |
| 151 | <param index="3" name="alpha" type="float" default="1.0" /> |
| 152 | <description> |
| 153 | Constructs a color from an [url=https://en.wikipedia.org/wiki/HSL_and_HSV]HSV profile[/url]. The hue ([param h]), saturation ([param s]), and value ([param v]) are typically between 0.0 and 1.0. |
| 154 | [codeblocks] |
| 155 | [gdscript] |
| 156 | var color = Color.from_hsv(0.58, 0.5, 0.79, 0.8) |
| 157 | [/gdscript] |
| 158 | [csharp] |
| 159 | var color = Color.FromHsv(0.58f, 0.5f, 0.79f, 0.8f); |
| 160 | [/csharp] |
| 161 | [/codeblocks] |
| 162 | </description> |
| 163 | </method> |
| 164 | <method name="from_ok_hsl" qualifiers="static"> |
| 165 | <return type="Color" /> |
| 166 | <param index="0" name="h" type="float" /> |
| 167 | <param index="1" name="s" type="float" /> |
| 168 | <param index="2" name="l" type="float" /> |
| 169 | <param index="3" name="alpha" type="float" default="1.0" /> |
| 170 | <description> |
| 171 | Constructs a color from an [url=https://bottosson.github.io/posts/colorpicker/]OK HSL profile[/url]. The hue ([param h]), saturation ([param s]), and lightness ([param l]) are typically between 0.0 and 1.0. |
| 172 | [codeblocks] |
| 173 | [gdscript] |
| 174 | var color = Color.from_ok_hsl(0.58, 0.5, 0.79, 0.8) |
| 175 | [/gdscript] |
| 176 | [csharp] |
| 177 | var color = Color.FromOkHsl(0.58f, 0.5f, 0.79f, 0.8f); |
| 178 | [/csharp] |
| 179 | [/codeblocks] |
| 180 | </description> |
| 181 | </method> |
| 182 | <method name="from_rgba8" qualifiers="static"> |
| 183 | <return type="Color" /> |
| 184 | <param index="0" name="r8" type="int" /> |
| 185 | <param index="1" name="g8" type="int" /> |
| 186 | <param index="2" name="b8" type="int" /> |
| 187 | <param index="3" name="a8" type="int" default="255" /> |
| 188 | <description> |
| 189 | Returns a [Color] constructed from red ([param r8]), green ([param g8]), blue ([param b8]), and optionally alpha ([param a8]) integer channels, each divided by [code]255.0[/code] for their final value. |
| 190 | [codeblock] |
| 191 | var red = Color.from_rgba8(255, 0, 0) # Same as Color(1, 0, 0). |
| 192 | var dark_blue = Color.from_rgba8(0, 0, 51) # Same as Color(0, 0, 0.2). |
| 193 | var my_color = Color.from_rgba8(306, 255, 0, 102) # Same as Color(1.2, 1, 0, 0.4). |
| 194 | [/codeblock] |
| 195 | [b]Note:[/b] Due to the lower precision of [method from_rgba8] compared to the standard [Color] constructor, a color created with [method from_rgba8] will generally not be equal to the same color created with the standard [Color] constructor. Use [method is_equal_approx] for comparisons to avoid issues with floating-point precision error. |
| 196 | </description> |
| 197 | </method> |
| 198 | <method name="from_rgbe9995" qualifiers="static"> |
| 199 | <return type="Color" /> |
| 200 | <param index="0" name="rgbe" type="int" /> |
| 201 | <description> |
| 202 | Decodes a [Color] from an RGBE9995 format integer. See [constant Image.FORMAT_RGBE9995]. |
| 203 | </description> |
| 204 | </method> |
| 205 | <method name="from_string" qualifiers="static"> |
| 206 | <return type="Color" /> |
| 207 | <param index="0" name="str" type="String" /> |
| 208 | <param index="1" name="default" type="Color" /> |
| 209 | <description> |
| 210 | Creates a [Color] from the given string, which can be either an HTML color code or a named color (case-insensitive). Returns [param default] if the color cannot be inferred from the string. |
| 211 | If you want to create a color from String in a constant expression, use the equivalent constructor instead (i.e. [code]Color("color string")[/code]). |
| 212 | </description> |
| 213 | </method> |
| 214 | <method name="get_luminance" qualifiers="const"> |
| 215 | <return type="float" /> |
| 216 | <description> |
| 217 | Returns the light intensity of the color, as a value between 0.0 and 1.0 (inclusive). This is useful when determining light or dark color. Colors with a luminance smaller than 0.5 can be generally considered dark. |
| 218 | [b]Note:[/b] [method get_luminance] relies on the color using linear encoding to return an accurate relative luminance value. If the color uses the default nonlinear sRGB encoding, use [method srgb_to_linear] to convert it to linear encoding first. |
| 219 | </description> |
| 220 | </method> |
| 221 | <method name="hex" qualifiers="static" keywords="from_rgba32"> |
| 222 | <return type="Color" /> |
| 223 | <param index="0" name="hex" type="int" /> |
| 224 | <description> |
| 225 | Returns the [Color] associated with the provided [param hex] integer in 32-bit RGBA format (8 bits per channel). This method is the inverse of [method to_rgba32]. |
| 226 | In GDScript and C#, the [int] is best visualized with hexadecimal notation ([code]"0x"[/code] prefix, making it [code]"0xRRGGBBAA"[/code]). |
| 227 | [codeblocks] |
| 228 | [gdscript] |
| 229 | var red = Color.hex(0xff0000ff) |
| 230 | var dark_cyan = Color.hex(0x008b8bff) |
| 231 | var my_color = Color.hex(0xbbefd2a4) |
| 232 | [/gdscript] |
| 233 | [csharp] |
| 234 | var red = new Color(0xff0000ff); |
| 235 | var dark_cyan = new Color(0x008b8bff); |
| 236 | var my_color = new Color(0xbbefd2a4); |
| 237 | [/csharp] |
| 238 | [/codeblocks] |
| 239 | If you want to use hex notation in a constant expression, use the equivalent constructor instead (i.e. [code]Color(0xRRGGBBAA)[/code]). |
| 240 | </description> |
| 241 | </method> |
| 242 | <method name="hex64" qualifiers="static" keywords="from_rgba64"> |
| 243 | <return type="Color" /> |
| 244 | <param index="0" name="hex" type="int" /> |
| 245 | <description> |
| 246 | Returns the [Color] associated with the provided [param hex] integer in 64-bit RGBA format (16 bits per channel). This method is the inverse of [method to_rgba64]. |
| 247 | In GDScript and C#, the [int] is best visualized with hexadecimal notation ([code]"0x"[/code] prefix, making it [code]"0xRRRRGGGGBBBBAAAA"[/code]). |
| 248 | </description> |
| 249 | </method> |
| 250 | <method name="html" qualifiers="static"> |
| 251 | <return type="Color" /> |
| 252 | <param index="0" name="rgba" type="String" /> |
| 253 | <description> |
| 254 | Returns a new color from [param rgba], an HTML hexadecimal color string. [param rgba] is not case-sensitive, and may be prefixed by a hash sign ([code]#[/code]). |
| 255 | [param rgba] must be a valid three-digit or six-digit hexadecimal color string, and may contain an alpha channel value. If [param rgba] does not contain an alpha channel value, an alpha channel value of 1.0 is applied. If [param rgba] is invalid, returns an empty color. |
| 256 | [codeblocks] |
| 257 | [gdscript] |
| 258 | var blue = Color.html("#0000ff") # blue is Color(0.0, 0.0, 1.0, 1.0) |
| 259 | var green = Color.html("#0F0") # green is Color(0.0, 1.0, 0.0, 1.0) |
| 260 | var col = Color.html("663399cc") # col is Color(0.4, 0.2, 0.6, 0.8) |
| 261 | [/gdscript] |
| 262 | [csharp] |
| 263 | var blue = Color.FromHtml("#0000ff"); // blue is Color(0.0, 0.0, 1.0, 1.0) |
| 264 | var green = Color.FromHtml("#0F0"); // green is Color(0.0, 1.0, 0.0, 1.0) |
| 265 | var col = Color.FromHtml("663399cc"); // col is Color(0.4, 0.2, 0.6, 0.8) |
| 266 | [/csharp] |
| 267 | [/codeblocks] |
| 268 | </description> |
| 269 | </method> |
| 270 | <method name="html_is_valid" qualifiers="static"> |
| 271 | <return type="bool" /> |
| 272 | <param index="0" name="color" type="String" /> |
| 273 | <description> |
| 274 | Returns [code]true[/code] if [param color] is a valid HTML hexadecimal color string. The string must be a hexadecimal value (case-insensitive) of either 3, 4, 6 or 8 digits, and may be prefixed by a hash sign ([code]#[/code]). This method is identical to [method String.is_valid_html_color]. |
| 275 | [codeblocks] |
| 276 | [gdscript] |
| 277 | Color.html_is_valid("#55aaFF") # Returns true |
| 278 | Color.html_is_valid("#55AAFF20") # Returns true |
| 279 | Color.html_is_valid("55AAFF") # Returns true |
| 280 | Color.html_is_valid("#F2C") # Returns true |
| 281 | |
| 282 | Color.html_is_valid("#AABBC") # Returns false |
| 283 | Color.html_is_valid("#55aaFF5") # Returns false |
| 284 | [/gdscript] |
| 285 | [csharp] |
| 286 | Color.HtmlIsValid("#55AAFF"); // Returns true |
| 287 | Color.HtmlIsValid("#55AAFF20"); // Returns true |
| 288 | Color.HtmlIsValid("55AAFF"); // Returns true |
| 289 | Color.HtmlIsValid("#F2C"); // Returns true |
| 290 | |
| 291 | Color.HtmlIsValid("#AABBC"); // Returns false |
| 292 | Color.HtmlIsValid("#55aaFF5"); // Returns false |
| 293 | [/csharp] |
| 294 | [/codeblocks] |
| 295 | </description> |
| 296 | </method> |
| 297 | <method name="inverted" qualifiers="const"> |
| 298 | <return type="Color" /> |
| 299 | <description> |
| 300 | Returns the color with its [member r], [member g], and [member b] components inverted ([code](1 - r, 1 - g, 1 - b, a)[/code]). |
| 301 | [codeblocks] |
| 302 | [gdscript] |
| 303 | var black = Color.WHITE.inverted() |
| 304 | var color = Color(0.3, 0.4, 0.9) |
| 305 | var inverted_color = color.inverted() # Equivalent to `Color(0.7, 0.6, 0.1)` |
| 306 | [/gdscript] |
| 307 | [csharp] |
| 308 | var black = Colors.White.Inverted(); |
| 309 | var color = new Color(0.3f, 0.4f, 0.9f); |
| 310 | Color invertedColor = color.Inverted(); // Equivalent to `new Color(0.7f, 0.6f, 0.1f)` |
| 311 | [/csharp] |
| 312 | [/codeblocks] |
| 313 | </description> |
| 314 | </method> |
| 315 | <method name="is_equal_approx" qualifiers="const"> |
| 316 | <return type="bool" /> |
| 317 | <param index="0" name="to" type="Color" /> |
| 318 | <description> |
| 319 | Returns [code]true[/code] if this color and [param to] are approximately equal, by running [method @GlobalScope.is_equal_approx] on each component. |
| 320 | </description> |
| 321 | </method> |
| 322 | <method name="lerp" qualifiers="const" keywords="interpolate"> |
| 323 | <return type="Color" /> |
| 324 | <param index="0" name="to" type="Color" /> |
| 325 | <param index="1" name="weight" type="float" /> |
| 326 | <description> |
| 327 | Returns the linear interpolation between this color's components and [param to]'s components. The interpolation factor [param weight] should be between 0.0 and 1.0 (inclusive). See also [method @GlobalScope.lerp]. |
| 328 | [codeblocks] |
| 329 | [gdscript] |
| 330 | var red = Color(1.0, 0.0, 0.0) |
| 331 | var aqua = Color(0.0, 1.0, 0.8) |
| 332 | |
| 333 | red.lerp(aqua, 0.2) # Returns Color(0.8, 0.2, 0.16) |
| 334 | red.lerp(aqua, 0.5) # Returns Color(0.5, 0.5, 0.4) |
| 335 | red.lerp(aqua, 1.0) # Returns Color(0.0, 1.0, 0.8) |
| 336 | [/gdscript] |
| 337 | [csharp] |
| 338 | var red = new Color(1.0f, 0.0f, 0.0f); |
| 339 | var aqua = new Color(0.0f, 1.0f, 0.8f); |
| 340 | |
| 341 | red.Lerp(aqua, 0.2f); // Returns Color(0.8f, 0.2f, 0.16f) |
| 342 | red.Lerp(aqua, 0.5f); // Returns Color(0.5f, 0.5f, 0.4f) |
| 343 | red.Lerp(aqua, 1.0f); // Returns Color(0.0f, 1.0f, 0.8f) |
| 344 | [/csharp] |
| 345 | [/codeblocks] |
| 346 | </description> |
| 347 | </method> |
| 348 | <method name="lightened" qualifiers="const"> |
| 349 | <return type="Color" /> |
| 350 | <param index="0" name="amount" type="float" /> |
| 351 | <description> |
| 352 | Returns a new color resulting from making this color lighter by the specified [param amount], which should be a ratio from 0.0 to 1.0. See also [method darkened]. |
| 353 | [codeblocks] |
| 354 | [gdscript] |
| 355 | var green = Color(0.0, 1.0, 0.0) |
| 356 | var light_green = green.lightened(0.2) # 20% lighter than regular green |
| 357 | [/gdscript] |
| 358 | [csharp] |
| 359 | var green = new Color(0.0f, 1.0f, 0.0f); |
| 360 | Color lightGreen = green.Lightened(0.2f); // 20% lighter than regular green |
| 361 | [/csharp] |
| 362 | [/codeblocks] |
| 363 | </description> |
| 364 | </method> |
| 365 | <method name="linear_to_srgb" qualifiers="const"> |
| 366 | <return type="Color" /> |
| 367 | <description> |
| 368 | Returns a copy of the color that is encoded using the [url=https://en.wikipedia.org/wiki/SRGB]nonlinear sRGB transfer function[/url]. This method requires the original color to use linear encoding. See also [method srgb_to_linear] which performs the opposite operation. |
| 369 | [b]Note:[/b] The color's alpha channel ([member a]) is not affected. The alpha channel is always stored with linear encoding, regardless of the color space of the other color channels. |
| 370 | </description> |
| 371 | </method> |
| 372 | <method name="srgb_to_linear" qualifiers="const"> |
| 373 | <return type="Color" /> |
| 374 | <description> |
| 375 | Returns a copy of the color that uses linear encoding. This method requires the original color to be encoded using the [url=https://en.wikipedia.org/wiki/SRGB]nonlinear sRGB transfer function[/url]. See also [method linear_to_srgb] which performs the opposite operation. |
| 376 | [b]Note:[/b] The color's alpha channel ([member a]) is not affected. The alpha channel is always stored with linear encoding, regardless of the color space of the other color channels. |
| 377 | </description> |
| 378 | </method> |
| 379 | <method name="to_abgr32" qualifiers="const"> |
| 380 | <return type="int" /> |
| 381 | <description> |
| 382 | Returns the color converted to a 32-bit integer in ABGR format (each component is 8 bits). ABGR is the reversed version of the default RGBA format. |
| 383 | [codeblocks] |
| 384 | [gdscript] |
| 385 | var color = Color(1, 0.5, 0.2) |
| 386 | print(color.to_abgr32()) # Prints 4281565439 |
| 387 | [/gdscript] |
| 388 | [csharp] |
| 389 | var color = new Color(1.0f, 0.5f, 0.2f); |
| 390 | GD.Print(color.ToAbgr32()); // Prints 4281565439 |
| 391 | [/csharp] |
| 392 | [/codeblocks] |
| 393 | </description> |
| 394 | </method> |
| 395 | <method name="to_abgr64" qualifiers="const"> |
| 396 | <return type="int" /> |
| 397 | <description> |
| 398 | Returns the color converted to a 64-bit integer in ABGR format (each component is 16 bits). ABGR is the reversed version of the default RGBA format. |
| 399 | [codeblocks] |
| 400 | [gdscript] |
| 401 | var color = Color(1, 0.5, 0.2) |
| 402 | print(color.to_abgr64()) # Prints -225178692812801 |
| 403 | [/gdscript] |
| 404 | [csharp] |
| 405 | var color = new Color(1.0f, 0.5f, 0.2f); |
| 406 | GD.Print(color.ToAbgr64()); // Prints -225178692812801 |
| 407 | [/csharp] |
| 408 | [/codeblocks] |
| 409 | </description> |
| 410 | </method> |
| 411 | <method name="to_argb32" qualifiers="const"> |
| 412 | <return type="int" /> |
| 413 | <description> |
| 414 | Returns the color converted to a 32-bit integer in ARGB format (each component is 8 bits). ARGB is more compatible with DirectX. |
| 415 | [codeblocks] |
| 416 | [gdscript] |
| 417 | var color = Color(1, 0.5, 0.2) |
| 418 | print(color.to_argb32()) # Prints 4294934323 |
| 419 | [/gdscript] |
| 420 | [csharp] |
| 421 | var color = new Color(1.0f, 0.5f, 0.2f); |
| 422 | GD.Print(color.ToArgb32()); // Prints 4294934323 |
| 423 | [/csharp] |
| 424 | [/codeblocks] |
| 425 | </description> |
| 426 | </method> |
| 427 | <method name="to_argb64" qualifiers="const"> |
| 428 | <return type="int" /> |
| 429 | <description> |
| 430 | Returns the color converted to a 64-bit integer in ARGB format (each component is 16 bits). ARGB is more compatible with DirectX. |
| 431 | [codeblocks] |
| 432 | [gdscript] |
| 433 | var color = Color(1, 0.5, 0.2) |
| 434 | print(color.to_argb64()) # Prints -2147470541 |
| 435 | [/gdscript] |
| 436 | [csharp] |
| 437 | var color = new Color(1.0f, 0.5f, 0.2f); |
| 438 | GD.Print(color.ToArgb64()); // Prints -2147470541 |
| 439 | [/csharp] |
| 440 | [/codeblocks] |
| 441 | </description> |
| 442 | </method> |
| 443 | <method name="to_html" qualifiers="const"> |
| 444 | <return type="String" /> |
| 445 | <param index="0" name="with_alpha" type="bool" default="true" /> |
| 446 | <description> |
| 447 | Returns the color converted to an HTML hexadecimal color [String] in RGBA format, without the hash ([code]#[/code]) prefix. |
| 448 | Setting [param with_alpha] to [code]false[/code], excludes alpha from the hexadecimal string, using RGB format instead of RGBA format. |
| 449 | [codeblocks] |
| 450 | [gdscript] |
| 451 | var white = Color(1, 1, 1, 0.5) |
| 452 | var with_alpha = white.to_html() # Returns "ffffff7f" |
| 453 | var without_alpha = white.to_html(false) # Returns "ffffff" |
| 454 | [/gdscript] |
| 455 | [csharp] |
| 456 | var white = new Color(1, 1, 1, 0.5f); |
| 457 | string withAlpha = white.ToHtml(); // Returns "ffffff7f" |
| 458 | string withoutAlpha = white.ToHtml(false); // Returns "ffffff" |
| 459 | [/csharp] |
| 460 | [/codeblocks] |
| 461 | </description> |
| 462 | </method> |
| 463 | <method name="to_rgba32" qualifiers="const" keywords="to_hex"> |
| 464 | <return type="int" /> |
| 465 | <description> |
| 466 | Returns the color converted to a 32-bit integer in RGBA format (each component is 8 bits). RGBA is Godot's default format. This method is the inverse of [method hex]. |
| 467 | [codeblocks] |
| 468 | [gdscript] |
| 469 | var color = Color(1, 0.5, 0.2) |
| 470 | print(color.to_rgba32()) # Prints 4286526463 |
| 471 | [/gdscript] |
| 472 | [csharp] |
| 473 | var color = new Color(1, 0.5f, 0.2f); |
| 474 | GD.Print(color.ToRgba32()); // Prints 4286526463 |
| 475 | [/csharp] |
| 476 | [/codeblocks] |
| 477 | </description> |
| 478 | </method> |
| 479 | <method name="to_rgba64" qualifiers="const" keywords="to_hex64"> |
| 480 | <return type="int" /> |
| 481 | <description> |
| 482 | Returns the color converted to a 64-bit integer in RGBA format (each component is 16 bits). RGBA is Godot's default format. This method is the inverse of [method hex64]. |
| 483 | [codeblocks] |
| 484 | [gdscript] |
| 485 | var color = Color(1, 0.5, 0.2) |
| 486 | print(color.to_rgba64()) # Prints -140736629309441 |
| 487 | [/gdscript] |
| 488 | [csharp] |
| 489 | var color = new Color(1, 0.5f, 0.2f); |
| 490 | GD.Print(color.ToRgba64()); // Prints -140736629309441 |
| 491 | [/csharp] |
| 492 | [/codeblocks] |
| 493 | </description> |
| 494 | </method> |
| 495 | </methods> |
| 496 | <members> |
| 497 | <member name="a" type="float" setter="" getter="" default="1.0"> |
| 498 | The color's alpha component, typically on the range of 0 to 1. A value of 0 means that the color is fully transparent. A value of 1 means that the color is fully opaque. |
| 499 | [b]Note:[/b] The alpha channel is always stored with linear encoding, regardless of the encoding of the other color channels. The [method linear_to_srgb] and [method srgb_to_linear] methods do not affect the alpha channel. |
| 500 | </member> |
| 501 | <member name="a8" type="int" setter="" getter="" default="255"> |
| 502 | Wrapper for [member a] that uses the range 0 to 255, instead of 0 to 1. |
| 503 | </member> |
| 504 | <member name="b" type="float" setter="" getter="" default="0.0"> |
| 505 | The color's blue component, typically on the range of 0 to 1. |
| 506 | </member> |
| 507 | <member name="b8" type="int" setter="" getter="" default="0"> |
| 508 | Wrapper for [member b] that uses the range 0 to 255, instead of 0 to 1. |
| 509 | </member> |
| 510 | <member name="g" type="float" setter="" getter="" default="0.0"> |
| 511 | The color's green component, typically on the range of 0 to 1. |
| 512 | </member> |
| 513 | <member name="g8" type="int" setter="" getter="" default="0"> |
| 514 | Wrapper for [member g] that uses the range 0 to 255, instead of 0 to 1. |
| 515 | </member> |
| 516 | <member name="h" type="float" setter="" getter="" default="0.0"> |
| 517 | The HSV hue of this color, on the range 0 to 1. |
| 518 | </member> |
| 519 | <member name="ok_hsl_h" type="float" setter="" getter="" default="0.0"> |
| 520 | The OKHSL hue of this color, on the range 0 to 1. |
| 521 | </member> |
| 522 | <member name="ok_hsl_l" type="float" setter="" getter="" default="0.0"> |
| 523 | The OKHSL lightness of this color, on the range 0 to 1. |
| 524 | </member> |
| 525 | <member name="ok_hsl_s" type="float" setter="" getter="" default="0.0"> |
| 526 | The OKHSL saturation of this color, on the range 0 to 1. |
| 527 | </member> |
| 528 | <member name="r" type="float" setter="" getter="" default="0.0"> |
| 529 | The color's red component, typically on the range of 0 to 1. |
| 530 | </member> |
| 531 | <member name="r8" type="int" setter="" getter="" default="0"> |
| 532 | Wrapper for [member r] that uses the range 0 to 255, instead of 0 to 1. |
| 533 | </member> |
| 534 | <member name="s" type="float" setter="" getter="" default="0.0"> |
| 535 | The HSV saturation of this color, on the range 0 to 1. |
| 536 | </member> |
| 537 | <member name="v" type="float" setter="" getter="" default="0.0"> |
| 538 | The HSV value (brightness) of this color, on the range 0 to 1. |
| 539 | </member> |
| 540 | </members> |
| 541 | <constants> |
| 542 | <constant name="ALICE_BLUE" value="Color(0.9411765, 0.972549, 1, 1)"> |
| 543 | Alice blue color. |
| 544 | </constant> |
| 545 | <constant name="ANTIQUE_WHITE" value="Color(0.98039216, 0.92156863, 0.84313726, 1)"> |
| 546 | Antique white color. |
| 547 | </constant> |
| 548 | <constant name="AQUA" value="Color(0, 1, 1, 1)"> |
| 549 | Aqua color. |
| 550 | </constant> |
| 551 | <constant name="AQUAMARINE" value="Color(0.49803922, 1, 0.83137256, 1)"> |
| 552 | Aquamarine color. |
| 553 | </constant> |
| 554 | <constant name="AZURE" value="Color(0.9411765, 1, 1, 1)"> |
| 555 | Azure color. |
| 556 | </constant> |
| 557 | <constant name="BEIGE" value="Color(0.9607843, 0.9607843, 0.8627451, 1)"> |
| 558 | Beige color. |
| 559 | </constant> |
| 560 | <constant name="BISQUE" value="Color(1, 0.89411765, 0.76862746, 1)"> |
| 561 | Bisque color. |
| 562 | </constant> |
| 563 | <constant name="BLACK" value="Color(0, 0, 0, 1)"> |
| 564 | Black color. In GDScript, this is the default value of any color. |
| 565 | </constant> |
| 566 | <constant name="BLANCHED_ALMOND" value="Color(1, 0.92156863, 0.8039216, 1)"> |
| 567 | Blanched almond color. |
| 568 | </constant> |
| 569 | <constant name="BLUE" value="Color(0, 0, 1, 1)"> |
| 570 | Blue color. |
| 571 | </constant> |
| 572 | <constant name="BLUE_VIOLET" value="Color(0.5411765, 0.16862746, 0.8862745, 1)"> |
| 573 | Blue violet color. |
| 574 | </constant> |
| 575 | <constant name="BROWN" value="Color(0.64705884, 0.16470589, 0.16470589, 1)"> |
| 576 | Brown color. |
| 577 | </constant> |
| 578 | <constant name="BURLYWOOD" value="Color(0.87058824, 0.72156864, 0.5294118, 1)"> |
| 579 | Burlywood color. |
| 580 | </constant> |
| 581 | <constant name="CADET_BLUE" value="Color(0.37254903, 0.61960787, 0.627451, 1)"> |
| 582 | Cadet blue color. |
| 583 | </constant> |
| 584 | <constant name="CHARTREUSE" value="Color(0.49803922, 1, 0, 1)"> |
| 585 | Chartreuse color. |
| 586 | </constant> |
| 587 | <constant name="CHOCOLATE" value="Color(0.8235294, 0.4117647, 0.11764706, 1)"> |
| 588 | Chocolate color. |
| 589 | </constant> |
| 590 | <constant name="CORAL" value="Color(1, 0.49803922, 0.3137255, 1)"> |
| 591 | Coral color. |
| 592 | </constant> |
| 593 | <constant name="CORNFLOWER_BLUE" value="Color(0.39215687, 0.58431375, 0.92941177, 1)"> |
| 594 | Cornflower blue color. |
| 595 | </constant> |
| 596 | <constant name="CORNSILK" value="Color(1, 0.972549, 0.8627451, 1)"> |
| 597 | Cornsilk color. |
| 598 | </constant> |
| 599 | <constant name="CRIMSON" value="Color(0.8627451, 0.078431375, 0.23529412, 1)"> |
| 600 | Crimson color. |
| 601 | </constant> |
| 602 | <constant name="CYAN" value="Color(0, 1, 1, 1)"> |
| 603 | Cyan color. |
| 604 | </constant> |
| 605 | <constant name="DARK_BLUE" value="Color(0, 0, 0.54509807, 1)"> |
| 606 | Dark blue color. |
| 607 | </constant> |
| 608 | <constant name="DARK_CYAN" value="Color(0, 0.54509807, 0.54509807, 1)"> |
| 609 | Dark cyan color. |
| 610 | </constant> |
| 611 | <constant name="DARK_GOLDENROD" value="Color(0.72156864, 0.5254902, 0.043137256, 1)"> |
| 612 | Dark goldenrod color. |
| 613 | </constant> |
| 614 | <constant name="DARK_GRAY" value="Color(0.6627451, 0.6627451, 0.6627451, 1)"> |
| 615 | Dark gray color. |
| 616 | </constant> |
| 617 | <constant name="DARK_GREEN" value="Color(0, 0.39215687, 0, 1)"> |
| 618 | Dark green color. |
| 619 | </constant> |
| 620 | <constant name="DARK_KHAKI" value="Color(0.7411765, 0.7176471, 0.41960785, 1)"> |
| 621 | Dark khaki color. |
| 622 | </constant> |
| 623 | <constant name="DARK_MAGENTA" value="Color(0.54509807, 0, 0.54509807, 1)"> |
| 624 | Dark magenta color. |
| 625 | </constant> |
| 626 | <constant name="DARK_OLIVE_GREEN" value="Color(0.33333334, 0.41960785, 0.18431373, 1)"> |
| 627 | Dark olive green color. |
| 628 | </constant> |
| 629 | <constant name="DARK_ORANGE" value="Color(1, 0.54901963, 0, 1)"> |
| 630 | Dark orange color. |
| 631 | </constant> |
| 632 | <constant name="DARK_ORCHID" value="Color(0.6, 0.19607843, 0.8, 1)"> |
| 633 | Dark orchid color. |
| 634 | </constant> |
| 635 | <constant name="DARK_RED" value="Color(0.54509807, 0, 0, 1)"> |
| 636 | Dark red color. |
| 637 | </constant> |
| 638 | <constant name="DARK_SALMON" value="Color(0.9137255, 0.5882353, 0.47843137, 1)"> |
| 639 | Dark salmon color. |
| 640 | </constant> |
| 641 | <constant name="DARK_SEA_GREEN" value="Color(0.56078434, 0.7372549, 0.56078434, 1)"> |
| 642 | Dark sea green color. |
| 643 | </constant> |
| 644 | <constant name="DARK_SLATE_BLUE" value="Color(0.28235295, 0.23921569, 0.54509807, 1)"> |
| 645 | Dark slate blue color. |
| 646 | </constant> |
| 647 | <constant name="DARK_SLATE_GRAY" value="Color(0.18431373, 0.30980393, 0.30980393, 1)"> |
| 648 | Dark slate gray color. |
| 649 | </constant> |
| 650 | <constant name="DARK_TURQUOISE" value="Color(0, 0.80784315, 0.81960785, 1)"> |
| 651 | Dark turquoise color. |
| 652 | </constant> |
| 653 | <constant name="DARK_VIOLET" value="Color(0.5803922, 0, 0.827451, 1)"> |
| 654 | Dark violet color. |
| 655 | </constant> |
| 656 | <constant name="DEEP_PINK" value="Color(1, 0.078431375, 0.5764706, 1)"> |
| 657 | Deep pink color. |
| 658 | </constant> |
| 659 | <constant name="DEEP_SKY_BLUE" value="Color(0, 0.7490196, 1, 1)"> |
| 660 | Deep sky blue color. |
| 661 | </constant> |
| 662 | <constant name="DIM_GRAY" value="Color(0.4117647, 0.4117647, 0.4117647, 1)"> |
| 663 | Dim gray color. |
| 664 | </constant> |
| 665 | <constant name="DODGER_BLUE" value="Color(0.11764706, 0.5647059, 1, 1)"> |
| 666 | Dodger blue color. |
| 667 | </constant> |
| 668 | <constant name="FIREBRICK" value="Color(0.69803923, 0.13333334, 0.13333334, 1)"> |
| 669 | Firebrick color. |
| 670 | </constant> |
| 671 | <constant name="FLORAL_WHITE" value="Color(1, 0.98039216, 0.9411765, 1)"> |
| 672 | Floral white color. |
| 673 | </constant> |
| 674 | <constant name="FOREST_GREEN" value="Color(0.13333334, 0.54509807, 0.13333334, 1)"> |
| 675 | Forest green color. |
| 676 | </constant> |
| 677 | <constant name="FUCHSIA" value="Color(1, 0, 1, 1)"> |
| 678 | Fuchsia color. |
| 679 | </constant> |
| 680 | <constant name="GAINSBORO" value="Color(0.8627451, 0.8627451, 0.8627451, 1)"> |
| 681 | Gainsboro color. |
| 682 | </constant> |
| 683 | <constant name="GHOST_WHITE" value="Color(0.972549, 0.972549, 1, 1)"> |
| 684 | Ghost white color. |
| 685 | </constant> |
| 686 | <constant name="GOLD" value="Color(1, 0.84313726, 0, 1)"> |
| 687 | Gold color. |
| 688 | </constant> |
| 689 | <constant name="GOLDENROD" value="Color(0.85490197, 0.64705884, 0.1254902, 1)"> |
| 690 | Goldenrod color. |
| 691 | </constant> |
| 692 | <constant name="GRAY" value="Color(0.74509805, 0.74509805, 0.74509805, 1)"> |
| 693 | Gray color. |
| 694 | </constant> |
| 695 | <constant name="GREEN" value="Color(0, 1, 0, 1)"> |
| 696 | Green color. |
| 697 | </constant> |
| 698 | <constant name="GREEN_YELLOW" value="Color(0.6784314, 1, 0.18431373, 1)"> |
| 699 | Green yellow color. |
| 700 | </constant> |
| 701 | <constant name="HONEYDEW" value="Color(0.9411765, 1, 0.9411765, 1)"> |
| 702 | Honeydew color. |
| 703 | </constant> |
| 704 | <constant name="HOT_PINK" value="Color(1, 0.4117647, 0.7058824, 1)"> |
| 705 | Hot pink color. |
| 706 | </constant> |
| 707 | <constant name="INDIAN_RED" value="Color(0.8039216, 0.36078432, 0.36078432, 1)"> |
| 708 | Indian red color. |
| 709 | </constant> |
| 710 | <constant name="INDIGO" value="Color(0.29411766, 0, 0.50980395, 1)"> |
| 711 | Indigo color. |
| 712 | </constant> |
| 713 | <constant name="IVORY" value="Color(1, 1, 0.9411765, 1)"> |
| 714 | Ivory color. |
| 715 | </constant> |
| 716 | <constant name="KHAKI" value="Color(0.9411765, 0.9019608, 0.54901963, 1)"> |
| 717 | Khaki color. |
| 718 | </constant> |
| 719 | <constant name="LAVENDER" value="Color(0.9019608, 0.9019608, 0.98039216, 1)"> |
| 720 | Lavender color. |
| 721 | </constant> |
| 722 | <constant name="LAVENDER_BLUSH" value="Color(1, 0.9411765, 0.9607843, 1)"> |
| 723 | Lavender blush color. |
| 724 | </constant> |
| 725 | <constant name="LAWN_GREEN" value="Color(0.4862745, 0.9882353, 0, 1)"> |
| 726 | Lawn green color. |
| 727 | </constant> |
| 728 | <constant name="LEMON_CHIFFON" value="Color(1, 0.98039216, 0.8039216, 1)"> |
| 729 | Lemon chiffon color. |
| 730 | </constant> |
| 731 | <constant name="LIGHT_BLUE" value="Color(0.6784314, 0.84705883, 0.9019608, 1)"> |
| 732 | Light blue color. |
| 733 | </constant> |
| 734 | <constant name="LIGHT_CORAL" value="Color(0.9411765, 0.5019608, 0.5019608, 1)"> |
| 735 | Light coral color. |
| 736 | </constant> |
| 737 | <constant name="LIGHT_CYAN" value="Color(0.8784314, 1, 1, 1)"> |
| 738 | Light cyan color. |
| 739 | </constant> |
| 740 | <constant name="LIGHT_GOLDENROD" value="Color(0.98039216, 0.98039216, 0.8235294, 1)"> |
| 741 | Light goldenrod color. |
| 742 | </constant> |
| 743 | <constant name="LIGHT_GRAY" value="Color(0.827451, 0.827451, 0.827451, 1)"> |
| 744 | Light gray color. |
| 745 | </constant> |
| 746 | <constant name="LIGHT_GREEN" value="Color(0.5647059, 0.93333334, 0.5647059, 1)"> |
| 747 | Light green color. |
| 748 | </constant> |
| 749 | <constant name="LIGHT_PINK" value="Color(1, 0.7137255, 0.75686276, 1)"> |
| 750 | Light pink color. |
| 751 | </constant> |
| 752 | <constant name="LIGHT_SALMON" value="Color(1, 0.627451, 0.47843137, 1)"> |
| 753 | Light salmon color. |
| 754 | </constant> |
| 755 | <constant name="LIGHT_SEA_GREEN" value="Color(0.1254902, 0.69803923, 0.6666667, 1)"> |
| 756 | Light sea green color. |
| 757 | </constant> |
| 758 | <constant name="LIGHT_SKY_BLUE" value="Color(0.5294118, 0.80784315, 0.98039216, 1)"> |
| 759 | Light sky blue color. |
| 760 | </constant> |
| 761 | <constant name="LIGHT_SLATE_GRAY" value="Color(0.46666667, 0.53333336, 0.6, 1)"> |
| 762 | Light slate gray color. |
| 763 | </constant> |
| 764 | <constant name="LIGHT_STEEL_BLUE" value="Color(0.6901961, 0.76862746, 0.87058824, 1)"> |
| 765 | Light steel blue color. |
| 766 | </constant> |
| 767 | <constant name="LIGHT_YELLOW" value="Color(1, 1, 0.8784314, 1)"> |
| 768 | Light yellow color. |
| 769 | </constant> |
| 770 | <constant name="LIME" value="Color(0, 1, 0, 1)"> |
| 771 | Lime color. |
| 772 | </constant> |
| 773 | <constant name="LIME_GREEN" value="Color(0.19607843, 0.8039216, 0.19607843, 1)"> |
| 774 | Lime green color. |
| 775 | </constant> |
| 776 | <constant name="LINEN" value="Color(0.98039216, 0.9411765, 0.9019608, 1)"> |
| 777 | Linen color. |
| 778 | </constant> |
| 779 | <constant name="MAGENTA" value="Color(1, 0, 1, 1)"> |
| 780 | Magenta color. |
| 781 | </constant> |
| 782 | <constant name="MAROON" value="Color(0.6901961, 0.1882353, 0.3764706, 1)"> |
| 783 | Maroon color. |
| 784 | </constant> |
| 785 | <constant name="MEDIUM_AQUAMARINE" value="Color(0.4, 0.8039216, 0.6666667, 1)"> |
| 786 | Medium aquamarine color. |
| 787 | </constant> |
| 788 | <constant name="MEDIUM_BLUE" value="Color(0, 0, 0.8039216, 1)"> |
| 789 | Medium blue color. |
| 790 | </constant> |
| 791 | <constant name="MEDIUM_ORCHID" value="Color(0.7294118, 0.33333334, 0.827451, 1)"> |
| 792 | Medium orchid color. |
| 793 | </constant> |
| 794 | <constant name="MEDIUM_PURPLE" value="Color(0.5764706, 0.4392157, 0.85882354, 1)"> |
| 795 | Medium purple color. |
| 796 | </constant> |
| 797 | <constant name="MEDIUM_SEA_GREEN" value="Color(0.23529412, 0.7019608, 0.44313726, 1)"> |
| 798 | Medium sea green color. |
| 799 | </constant> |
| 800 | <constant name="MEDIUM_SLATE_BLUE" value="Color(0.48235294, 0.40784314, 0.93333334, 1)"> |
| 801 | Medium slate blue color. |
| 802 | </constant> |
| 803 | <constant name="MEDIUM_SPRING_GREEN" value="Color(0, 0.98039216, 0.6039216, 1)"> |
| 804 | Medium spring green color. |
| 805 | </constant> |
| 806 | <constant name="MEDIUM_TURQUOISE" value="Color(0.28235295, 0.81960785, 0.8, 1)"> |
| 807 | Medium turquoise color. |
| 808 | </constant> |
| 809 | <constant name="MEDIUM_VIOLET_RED" value="Color(0.78039217, 0.08235294, 0.52156866, 1)"> |
| 810 | Medium violet red color. |
| 811 | </constant> |
| 812 | <constant name="MIDNIGHT_BLUE" value="Color(0.09803922, 0.09803922, 0.4392157, 1)"> |
| 813 | Midnight blue color. |
| 814 | </constant> |
| 815 | <constant name="MINT_CREAM" value="Color(0.9607843, 1, 0.98039216, 1)"> |
| 816 | Mint cream color. |
| 817 | </constant> |
| 818 | <constant name="MISTY_ROSE" value="Color(1, 0.89411765, 0.88235295, 1)"> |
| 819 | Misty rose color. |
| 820 | </constant> |
| 821 | <constant name="MOCCASIN" value="Color(1, 0.89411765, 0.70980394, 1)"> |
| 822 | Moccasin color. |
| 823 | </constant> |
| 824 | <constant name="NAVAJO_WHITE" value="Color(1, 0.87058824, 0.6784314, 1)"> |
| 825 | Navajo white color. |
| 826 | </constant> |
| 827 | <constant name="NAVY_BLUE" value="Color(0, 0, 0.5019608, 1)"> |
| 828 | Navy blue color. |
| 829 | </constant> |
| 830 | <constant name="OLD_LACE" value="Color(0.99215686, 0.9607843, 0.9019608, 1)"> |
| 831 | Old lace color. |
| 832 | </constant> |
| 833 | <constant name="OLIVE" value="Color(0.5019608, 0.5019608, 0, 1)"> |
| 834 | Olive color. |
| 835 | </constant> |
| 836 | <constant name="OLIVE_DRAB" value="Color(0.41960785, 0.5568628, 0.13725491, 1)"> |
| 837 | Olive drab color. |
| 838 | </constant> |
| 839 | <constant name="ORANGE" value="Color(1, 0.64705884, 0, 1)"> |
| 840 | Orange color. |
| 841 | </constant> |
| 842 | <constant name="ORANGE_RED" value="Color(1, 0.27058825, 0, 1)"> |
| 843 | Orange red color. |
| 844 | </constant> |
| 845 | <constant name="ORCHID" value="Color(0.85490197, 0.4392157, 0.8392157, 1)"> |
| 846 | Orchid color. |
| 847 | </constant> |
| 848 | <constant name="PALE_GOLDENROD" value="Color(0.93333334, 0.9098039, 0.6666667, 1)"> |
| 849 | Pale goldenrod color. |
| 850 | </constant> |
| 851 | <constant name="PALE_GREEN" value="Color(0.59607846, 0.9843137, 0.59607846, 1)"> |
| 852 | Pale green color. |
| 853 | </constant> |
| 854 | <constant name="PALE_TURQUOISE" value="Color(0.6862745, 0.93333334, 0.93333334, 1)"> |
| 855 | Pale turquoise color. |
| 856 | </constant> |
| 857 | <constant name="PALE_VIOLET_RED" value="Color(0.85882354, 0.4392157, 0.5764706, 1)"> |
| 858 | Pale violet red color. |
| 859 | </constant> |
| 860 | <constant name="PAPAYA_WHIP" value="Color(1, 0.9372549, 0.8352941, 1)"> |
| 861 | Papaya whip color. |
| 862 | </constant> |
| 863 | <constant name="PEACH_PUFF" value="Color(1, 0.85490197, 0.7254902, 1)"> |
| 864 | Peach puff color. |
| 865 | </constant> |
| 866 | <constant name="PERU" value="Color(0.8039216, 0.52156866, 0.24705882, 1)"> |
| 867 | Peru color. |
| 868 | </constant> |
| 869 | <constant name="PINK" value="Color(1, 0.7529412, 0.79607844, 1)"> |
| 870 | Pink color. |
| 871 | </constant> |
| 872 | <constant name="PLUM" value="Color(0.8666667, 0.627451, 0.8666667, 1)"> |
| 873 | Plum color. |
| 874 | </constant> |
| 875 | <constant name="POWDER_BLUE" value="Color(0.6901961, 0.8784314, 0.9019608, 1)"> |
| 876 | Powder blue color. |
| 877 | </constant> |
| 878 | <constant name="PURPLE" value="Color(0.627451, 0.1254902, 0.9411765, 1)"> |
| 879 | Purple color. |
| 880 | </constant> |
| 881 | <constant name="REBECCA_PURPLE" value="Color(0.4, 0.2, 0.6, 1)"> |
| 882 | Rebecca purple color. |
| 883 | </constant> |
| 884 | <constant name="RED" value="Color(1, 0, 0, 1)"> |
| 885 | Red color. |
| 886 | </constant> |
| 887 | <constant name="ROSY_BROWN" value="Color(0.7372549, 0.56078434, 0.56078434, 1)"> |
| 888 | Rosy brown color. |
| 889 | </constant> |
| 890 | <constant name="ROYAL_BLUE" value="Color(0.25490198, 0.4117647, 0.88235295, 1)"> |
| 891 | Royal blue color. |
| 892 | </constant> |
| 893 | <constant name="SADDLE_BROWN" value="Color(0.54509807, 0.27058825, 0.07450981, 1)"> |
| 894 | Saddle brown color. |
| 895 | </constant> |
| 896 | <constant name="SALMON" value="Color(0.98039216, 0.5019608, 0.44705883, 1)"> |
| 897 | Salmon color. |
| 898 | </constant> |
| 899 | <constant name="SANDY_BROWN" value="Color(0.95686275, 0.6431373, 0.3764706, 1)"> |
| 900 | Sandy brown color. |
| 901 | </constant> |
| 902 | <constant name="SEA_GREEN" value="Color(0.18039216, 0.54509807, 0.34117648, 1)"> |
| 903 | Sea green color. |
| 904 | </constant> |
| 905 | <constant name="SEASHELL" value="Color(1, 0.9607843, 0.93333334, 1)"> |
| 906 | Seashell color. |
| 907 | </constant> |
| 908 | <constant name="SIENNA" value="Color(0.627451, 0.32156864, 0.1764706, 1)"> |
| 909 | Sienna color. |
| 910 | </constant> |
| 911 | <constant name="SILVER" value="Color(0.7529412, 0.7529412, 0.7529412, 1)"> |
| 912 | Silver color. |
| 913 | </constant> |
| 914 | <constant name="SKY_BLUE" value="Color(0.5294118, 0.80784315, 0.92156863, 1)"> |
| 915 | Sky blue color. |
| 916 | </constant> |
| 917 | <constant name="SLATE_BLUE" value="Color(0.41568628, 0.3529412, 0.8039216, 1)"> |
| 918 | Slate blue color. |
| 919 | </constant> |
| 920 | <constant name="SLATE_GRAY" value="Color(0.4392157, 0.5019608, 0.5647059, 1)"> |
| 921 | Slate gray color. |
| 922 | </constant> |
| 923 | <constant name="SNOW" value="Color(1, 0.98039216, 0.98039216, 1)"> |
| 924 | Snow color. |
| 925 | </constant> |
| 926 | <constant name="SPRING_GREEN" value="Color(0, 1, 0.49803922, 1)"> |
| 927 | Spring green color. |
| 928 | </constant> |
| 929 | <constant name="STEEL_BLUE" value="Color(0.27450982, 0.50980395, 0.7058824, 1)"> |
| 930 | Steel blue color. |
| 931 | </constant> |
| 932 | <constant name="TAN" value="Color(0.8235294, 0.7058824, 0.54901963, 1)"> |
| 933 | Tan color. |
| 934 | </constant> |
| 935 | <constant name="TEAL" value="Color(0, 0.5019608, 0.5019608, 1)"> |
| 936 | Teal color. |
| 937 | </constant> |
| 938 | <constant name="THISTLE" value="Color(0.84705883, 0.7490196, 0.84705883, 1)"> |
| 939 | Thistle color. |
| 940 | </constant> |
| 941 | <constant name="TOMATO" value="Color(1, 0.3882353, 0.2784314, 1)"> |
| 942 | Tomato color. |
| 943 | </constant> |
| 944 | <constant name="TRANSPARENT" value="Color(1, 1, 1, 0)"> |
| 945 | Transparent color (white with zero alpha). |
| 946 | </constant> |
| 947 | <constant name="TURQUOISE" value="Color(0.2509804, 0.8784314, 0.8156863, 1)"> |
| 948 | Turquoise color. |
| 949 | </constant> |
| 950 | <constant name="VIOLET" value="Color(0.93333334, 0.50980395, 0.93333334, 1)"> |
| 951 | Violet color. |
| 952 | </constant> |
| 953 | <constant name="WEB_GRAY" value="Color(0.5019608, 0.5019608, 0.5019608, 1)"> |
| 954 | Web gray color. |
| 955 | </constant> |
| 956 | <constant name="WEB_GREEN" value="Color(0, 0.5019608, 0, 1)"> |
| 957 | Web green color. |
| 958 | </constant> |
| 959 | <constant name="WEB_MAROON" value="Color(0.5019608, 0, 0, 1)"> |
| 960 | Web maroon color. |
| 961 | </constant> |
| 962 | <constant name="WEB_PURPLE" value="Color(0.5019608, 0, 0.5019608, 1)"> |
| 963 | Web purple color. |
| 964 | </constant> |
| 965 | <constant name="WHEAT" value="Color(0.9607843, 0.87058824, 0.7019608, 1)"> |
| 966 | Wheat color. |
| 967 | </constant> |
| 968 | <constant name="WHITE" value="Color(1, 1, 1, 1)"> |
| 969 | White color. |
| 970 | </constant> |
| 971 | <constant name="WHITE_SMOKE" value="Color(0.9607843, 0.9607843, 0.9607843, 1)"> |
| 972 | White smoke color. |
| 973 | </constant> |
| 974 | <constant name="YELLOW" value="Color(1, 1, 0, 1)"> |
| 975 | Yellow color. |
| 976 | </constant> |
| 977 | <constant name="YELLOW_GREEN" value="Color(0.6039216, 0.8039216, 0.19607843, 1)"> |
| 978 | Yellow green color. |
| 979 | </constant> |
| 980 | </constants> |
| 981 | <operators> |
| 982 | <operator name="operator !="> |
| 983 | <return type="bool" /> |
| 984 | <param index="0" name="right" type="Color" /> |
| 985 | <description> |
| 986 | Returns [code]true[/code] if the colors are not exactly equal. |
| 987 | [b]Note:[/b] Due to floating-point precision errors, consider using [method is_equal_approx] instead, which is more reliable. |
| 988 | </description> |
| 989 | </operator> |
| 990 | <operator name="operator *"> |
| 991 | <return type="Color" /> |
| 992 | <param index="0" name="right" type="Color" /> |
| 993 | <description> |
| 994 | Multiplies each component of the [Color] by the components of the given [Color]. |
| 995 | </description> |
| 996 | </operator> |
| 997 | <operator name="operator *"> |
| 998 | <return type="Color" /> |
| 999 | <param index="0" name="right" type="float" /> |
| 1000 | <description> |
| 1001 | Multiplies each component of the [Color] by the given [float]. |
| 1002 | </description> |
| 1003 | </operator> |
| 1004 | <operator name="operator *"> |
| 1005 | <return type="Color" /> |
| 1006 | <param index="0" name="right" type="int" /> |
| 1007 | <description> |
| 1008 | Multiplies each component of the [Color] by the given [int]. |
| 1009 | </description> |
| 1010 | </operator> |
| 1011 | <operator name="operator +"> |
| 1012 | <return type="Color" /> |
| 1013 | <param index="0" name="right" type="Color" /> |
| 1014 | <description> |
| 1015 | Adds each component of the [Color] with the components of the given [Color]. |
| 1016 | </description> |
| 1017 | </operator> |
| 1018 | <operator name="operator -"> |
| 1019 | <return type="Color" /> |
| 1020 | <param index="0" name="right" type="Color" /> |
| 1021 | <description> |
| 1022 | Subtracts each component of the [Color] by the components of the given [Color]. |
| 1023 | </description> |
| 1024 | </operator> |
| 1025 | <operator name="operator /"> |
| 1026 | <return type="Color" /> |
| 1027 | <param index="0" name="right" type="Color" /> |
| 1028 | <description> |
| 1029 | Divides each component of the [Color] by the components of the given [Color]. |
| 1030 | </description> |
| 1031 | </operator> |
| 1032 | <operator name="operator /"> |
| 1033 | <return type="Color" /> |
| 1034 | <param index="0" name="right" type="float" /> |
| 1035 | <description> |
| 1036 | Divides each component of the [Color] by the given [float]. |
| 1037 | </description> |
| 1038 | </operator> |
| 1039 | <operator name="operator /"> |
| 1040 | <return type="Color" /> |
| 1041 | <param index="0" name="right" type="int" /> |
| 1042 | <description> |
| 1043 | Divides each component of the [Color] by the given [int]. |
| 1044 | </description> |
| 1045 | </operator> |
| 1046 | <operator name="operator =="> |
| 1047 | <return type="bool" /> |
| 1048 | <param index="0" name="right" type="Color" /> |
| 1049 | <description> |
| 1050 | Returns [code]true[/code] if the colors are exactly equal. |
| 1051 | [b]Note:[/b] Due to floating-point precision errors, consider using [method is_equal_approx] instead, which is more reliable. |
| 1052 | </description> |
| 1053 | </operator> |
| 1054 | <operator name="operator []"> |
| 1055 | <return type="float" /> |
| 1056 | <param index="0" name="index" type="int" /> |
| 1057 | <description> |
| 1058 | Access color components using their index. [code][0][/code] is equivalent to [member r], [code][1][/code] is equivalent to [member g], [code][2][/code] is equivalent to [member b], and [code][3][/code] is equivalent to [member a]. |
| 1059 | </description> |
| 1060 | </operator> |
| 1061 | <operator name="operator unary+"> |
| 1062 | <return type="Color" /> |
| 1063 | <description> |
| 1064 | Returns the same value as if the [code]+[/code] was not there. Unary [code]+[/code] does nothing, but sometimes it can make your code more readable. |
| 1065 | </description> |
| 1066 | </operator> |
| 1067 | <operator name="operator unary-"> |
| 1068 | <return type="Color" /> |
| 1069 | <description> |
| 1070 | Inverts the given color. This is equivalent to [code]Color.WHITE - c[/code] or [code]Color(1 - c.r, 1 - c.g, 1 - c.b, 1 - c.a)[/code]. Unlike with [method inverted], the [member a] component is inverted, too. |
| 1071 | </description> |
| 1072 | </operator> |
| 1073 | </operators> |
| 1074 | </class> |