Click or drag to resize

Color Methods

The Color type exposes the following members.

Methods
  NameDescription
Public methodBlend
Returns a new color resulting from blending this color over another. If the color is opaque, the result is also opaque. The second color may have a range of alpha values.
Public methodStatic memberColor8
Returns a color constructed from integer red, green, blue, and alpha channels. Each channel should have 8 bits of information ranging from 0 to 255.
Public methodStatic memberColorN
Returns a color according to the standardized name, with the specified alpha value. Supported color names are the same as the constants defined in Colors.
Public methodContrasted
Returns the most contrasting color.
Public methodDarkened
Returns a new color resulting from making this color darker by the specified ratio (on the range of 0 to 1).
Public methodEquals(Object) (Overrides ValueTypeEquals(Object).)
Public methodEquals(Color)
Public methodStatic memberFromHsv
Constructs a color from an HSV profile, with values on the range of 0 to 1. This is equivalent to using each of the `h`/`s`/`v` properties, but much more efficient.
Public methodGetHashCode (Overrides ValueTypeGetHashCode.)
Public methodGetType (Inherited from Object.)
Public methodInverted
Returns the inverted color: `(1 - r, 1 - g, 1 - b, a)`.
Public methodIsEqualApprox
Returns true if this color and `other` are approximately equal, by running IsEqualApprox(Single, Single) on each component.
Public methodLightened
Returns a new color resulting from making this color lighter by the specified ratio (on the range of 0 to 1).
Public methodLinearInterpolate(Color, Color)
Returns the result of the linear interpolation between this color and `to` by color amount `weight`.
Public methodLinearInterpolate(Color, Single)
Returns the result of the linear interpolation between this color and `to` by amount `weight`.
Public methodToAbgr32
Returns the color converted to a 32-bit integer in ABGR format (each byte represents a color channel). ABGR is the reversed version of the default format.
Public methodToAbgr64
Returns the color converted to a 64-bit integer in ABGR format (each word represents a color channel). ABGR is the reversed version of the default format.
Public methodToArgb32
Returns the color converted to a 32-bit integer in ARGB format (each byte represents a color channel). ARGB is more compatible with DirectX, but not used much in Godot.
Public methodToArgb64
Returns the color converted to a 64-bit integer in ARGB format (each word represents a color channel). ARGB is more compatible with DirectX, but not used much in Godot.
Public methodToHsv
Converts a color to HSV values. This is equivalent to using each of the `h`/`s`/`v` properties, but much more efficient.
Public methodToHtml
Returns the color's HTML hexadecimal color string in RGBA format.
Public methodToRgba32
Returns the color converted to a 32-bit integer in RGBA format (each byte represents a color channel). RGBA is Godot's default and recommended format.
Public methodToRgba64
Returns the color converted to a 64-bit integer in RGBA format (each word represents a color channel). RGBA is Godot's default and recommended format.
Public methodToString (Overrides ValueTypeToString.)
Public methodToString(String)
Top
See Also