Documentation
¶
Overview ¶
Package Gradient provides methods for working with Gradient object instances.
Index ¶
- type Advanced
- type Any
- type ColorSpace
- type Extension
- type ID
- 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) ID() ID
- func (self Instance) InterpolationColorSpace() ColorSpace
- func (self Instance) InterpolationMode() InterpolationMode
- 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 ColorSpace)
- func (self Instance) SetInterpolationMode(value InterpolationMode)
- func (self *Instance) SetObject(obj [1]gd.Object) bool
- 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 int //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 Extension ¶
Extension can be embedded in a new struct to create an extension of this class. T should be the type that is embedding this Extension
func (*Extension[T]) AsGradient ¶
func (*Extension[T]) AsRefCounted ¶
func (self *Extension[T]) AsRefCounted() [1]gd.RefCounted
func (*Extension[T]) AsResource ¶
type ID ¶
ID is a typed object ID (reference) to an instance of this class, use it to store references to objects with unknown lifetimes, as an ID will not panic on use if the underlying object has been destroyed.
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() ColorSpace
func (Instance) InterpolationMode ¶
func (self Instance) InterpolationMode() InterpolationMode
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 ColorSpace)
func (Instance) SetInterpolationMode ¶
func (self Instance) SetInterpolationMode(value InterpolationMode)
func (Instance) SetOffsets ¶
func (*Instance) UnsafePointer ¶
type InterpolationMode ¶
type InterpolationMode int //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 )