Gradient

A color interpolator resource which can be used to generate colors between user-defined color points.

Given a set of colors, this resource will interpolate them in order. This means that if you have color 1, color 2 and color 3, the ramp will interpolate from color 1 to color 2 and from color 2 to color 3. The ramp will initially have 2 colors (black and white), one (black) at ramp lower offset 0 and the other (white) at the ramp higher offset 1.

Members

Aliases

BaseClasses
alias BaseClasses = AliasSeq!(typeof(_GODOT_base), typeof(_GODOT_base).BaseClasses)
Undocumented in source.

Functions

addPoint
void addPoint(double offset, Color color)

Adds the specified color to the end of the ramp, with the specified offset.

getColor
Color getColor(long point)

Returns the color of the ramp color at index point.

getColors
PoolColorArray getColors()
getOffset
double getOffset(long point)

Returns the offset of the ramp color at index point.

getOffsets
PoolRealArray getOffsets()
getPointCount
long getPointCount()

Returns the number of colors in the ramp.

interpolate
Color interpolate(double offset)

Returns the interpolated color specified by offset.

opAssign
typeof(null) opAssign(typeof(null) n)
opEquals
bool opEquals(Gradient other)
opEquals
bool opEquals(typeof(null) n)
removePoint
void removePoint(long point)

Removes the color at the index point.

setColor
void setColor(long point, Color color)

Sets the color of the ramp color at index point.

setColors
void setColors(PoolColorArray colors)
setOffset
void setOffset(long point, double offset)

Sets the offset for the ramp color at index point.

setOffsets
void setOffsets(PoolRealArray offsets)
toHash
size_t toHash()

Mixins

__anonymous
mixin baseCasts
Undocumented in source.

Properties

colors
PoolColorArray colors [@property getter]
PoolColorArray colors [@property setter]

Gradient's colors returned as a PoolColorArray.

offsets
PoolRealArray offsets [@property getter]
PoolRealArray offsets [@property setter]

Gradient's offsets returned as a PoolRealArray.

Static functions

_new
Gradient _new()

Construct a new instance of Gradient. Note: use memnew!Gradient instead.

Static variables

_classBindingInitialized
bool _classBindingInitialized;
Undocumented in source.

Structs

GDNativeClassBinding
struct GDNativeClassBinding
Undocumented in source.

Unions

__anonymous
union __anonymous
Undocumented in source.

Variables

_GODOT_internal_name
enum string _GODOT_internal_name;
Undocumented in source.

Mixed In Members

From mixin baseCasts

as
inout(To) as()
Undocumented in source. Be warned that the author may not have intended to support it.
as
inout(To) as()
Undocumented in source. Be warned that the author may not have intended to support it.
as
inout(ToRef) as()
Undocumented in source. Be warned that the author may not have intended to support it.
opCast
template opCast(To)
Undocumented in source.
opCast
template opCast(To)
Undocumented in source.
opCast
template opCast(ToRef)
Undocumented in source.
opCast
void* opCast()
Undocumented in source. Be warned that the author may not have intended to support it.
opCast
godot_object opCast()
Undocumented in source. Be warned that the author may not have intended to support it.
opCast
bool opCast()
Undocumented in source. Be warned that the author may not have intended to support it.

Meta