Documentation
¶
Overview ¶
Package Gradient provides methods for working with Gradient object instances.
Index ¶
- type Advanced
- type Any
- type ColorSpace
- type Instance
- func (self Instance) AddPoint(offset Float.X, color Color.RGBA)
- func (self Instance) AsGradient() Instance
- func (self Instance) AsObject() [1]gd.Object
- func (self Instance) AsRefCounted() [1]gd.RefCounted
- func (self Instance) AsResource() Resource.Instance
- func (self Instance) Colors() []Color.RGBA
- func (self Instance) GetColor(point int) Color.RGBA
- func (self Instance) GetOffset(point int) Float.X
- func (self Instance) GetPointCount() int
- func (self Instance) InterpolationColorSpace() gdclass.GradientColorSpace
- func (self Instance) InterpolationMode() gdclass.GradientInterpolationMode
- func (self Instance) Offsets() []float32
- func (self Instance) RemovePoint(point int)
- func (self Instance) Reverse()
- func (self Instance) Sample(offset Float.X) Color.RGBA
- func (self Instance) SetColor(point int, color Color.RGBA)
- func (self Instance) SetColors(value []Color.RGBA)
- func (self Instance) SetInterpolationColorSpace(value gdclass.GradientColorSpace)
- func (self Instance) SetInterpolationMode(value gdclass.GradientInterpolationMode)
- func (self Instance) SetOffset(point int, offset Float.X)
- func (self Instance) SetOffsets(value []float32)
- func (self *Instance) UnsafePointer() unsafe.Pointer
- func (self Instance) Virtual(name string) reflect.Value
- type InterpolationMode
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Advanced ¶
type Advanced = class
Advanced exposes a 1:1 low-level instance of the class, undocumented, for those who know what they are doing.
type ColorSpace ¶
type ColorSpace = gdclass.GradientColorSpace //gd:Gradient.ColorSpace
const ( /*sRGB color space.*/ GradientColorSpaceSrgb ColorSpace = 0 /*Linear sRGB color space.*/ GradientColorSpaceLinearSrgb ColorSpace = 1 /*[url=https://bottosson.github.io/posts/oklab/]Oklab[/url] color space. This color space provides a smooth and uniform-looking transition between colors.*/ GradientColorSpaceOklab ColorSpace = 2 )
type Instance ¶
This resource describes a color transition by defining a set of colored points and how to interpolate between them. See also [Curve] which supports more complex easing methods, but does not support colors.
var Nil Instance
Nil is a nil/null instance of the class. Equivalent to the zero value.
func (Instance) AsGradient ¶
func (Instance) AsRefCounted ¶
func (self Instance) AsRefCounted() [1]gd.RefCounted
func (Instance) AsResource ¶
func (Instance) GetPointCount ¶
Returns the number of colors in the gradient.
func (Instance) InterpolationColorSpace ¶
func (self Instance) InterpolationColorSpace() gdclass.GradientColorSpace
func (Instance) InterpolationMode ¶
func (self Instance) InterpolationMode() gdclass.GradientInterpolationMode
func (Instance) RemovePoint ¶
Removes the color at index [param point].
func (Instance) Reverse ¶
func (self Instance) Reverse()
Reverses/mirrors the gradient. [b]Note:[/b] This method mirrors all points around the middle of the gradient, which may produce unexpected results when [member interpolation_mode] is set to [constant GRADIENT_INTERPOLATE_CONSTANT].
func (Instance) SetInterpolationColorSpace ¶
func (self Instance) SetInterpolationColorSpace(value gdclass.GradientColorSpace)
func (Instance) SetInterpolationMode ¶
func (self Instance) SetInterpolationMode(value gdclass.GradientInterpolationMode)
func (Instance) SetOffsets ¶
func (*Instance) UnsafePointer ¶
type InterpolationMode ¶
type InterpolationMode = gdclass.GradientInterpolationMode //gd:Gradient.InterpolationMode
const ( /*Linear interpolation.*/ GradientInterpolateLinear InterpolationMode = 0 /*Constant interpolation, color changes abruptly at each point and stays uniform between. This might cause visible aliasing when used for a gradient texture in some cases.*/ GradientInterpolateConstant InterpolationMode = 1 /*Cubic interpolation.*/ GradientInterpolateCubic InterpolationMode = 2 )