API Reference / @gtkx/cairo / LinearPattern
Class: LinearPattern
Defined in: pattern.d.ts:57
A linear gradient pattern, created with Pattern.createLinear.
Extends
Constructors
Constructor
new LinearPattern():
LinearPattern
Returns
LinearPattern
Inherited from
Properties
__type__
__type__:
bigint
Defined in: pattern.d.ts:24
GType of CairoPattern, the boxed type this class is registered under.
Inherited from
Methods
addColorStopRgb()
addColorStopRgb(
offset,red,green,blue):void
Defined in: pattern.d.ts:26
Adds an opaque color stop at offset (0 to 1) to a gradient pattern.
Parameters
offset
number
red
number
green
number
blue
number
Returns
void
Inherited from
addColorStopRgba()
addColorStopRgba(
offset,red,green,blue,alpha):void
Defined in: pattern.d.ts:28
Adds a translucent color stop at offset (0 to 1) to a gradient pattern.
Parameters
offset
number
red
number
green
number
blue
number
alpha
number
Returns
void
Inherited from
getColorStopCount()
getColorStopCount():
number
Defined in: pattern.d.ts:30
Returns how many color stops a gradient pattern has.
Returns
number
Inherited from
getColorStopRgba()
getColorStopRgba(
index):ColorStop
Defined in: pattern.d.ts:32
Returns the color stop at index of a gradient pattern.
Parameters
index
number
Returns
Inherited from
getExtend()
getExtend():
Extend
Defined in: pattern.d.ts:40
Returns how the pattern is extended outside its natural area.
Returns
Inherited from
getFilter()
getFilter():
Filter
Defined in: pattern.d.ts:44
Returns the filter used when the pattern is resampled.
Returns
Inherited from
getLinearPoints()
getLinearPoints():
LinearPoints
Defined in: pattern.d.ts:59
Returns the two end points of the gradient.
Returns
getMatrix()
getMatrix():
Matrix
Defined in: pattern.d.ts:48
Returns the transformation from user space to pattern space.
Returns
Inherited from
getReferenceCount()
getReferenceCount():
number
Defined in: pattern.d.ts:52
Returns the reference count of the pattern.
Returns
number
Inherited from
getRgba()
getRgba():
RgbaColor
Defined in: pattern.d.ts:34
Returns the color of a solid pattern.
Returns
Inherited from
getSurface()
getSurface():
Surface
Defined in: pattern.d.ts:54
Returns the surface of a surface pattern; throws for a pattern that has no surface.
Returns
Inherited from
getType()
getType():
PatternType
Defined in: pattern.d.ts:50
Returns the kind of pattern this is.
Returns
Inherited from
setExtend()
setExtend(
extend):void
Defined in: pattern.d.ts:38
Sets how the pattern is extended outside its natural area.
Parameters
extend
Returns
void
Inherited from
setFilter()
setFilter(
filter):void
Defined in: pattern.d.ts:42
Sets the filter used when the pattern is resampled.
Parameters
filter
Returns
void
Inherited from
setMatrix()
setMatrix(
matrix):void
Defined in: pattern.d.ts:46
Sets the transformation from user space to pattern space.
Parameters
matrix
Returns
void
Inherited from
status()
status():
Status
Defined in: pattern.d.ts:36
Returns the error status of the pattern, Status.SUCCESS when it is usable.
Returns
Inherited from
createForSurface()
staticcreateForSurface(surface):Pattern
Defined in: pattern.d.ts:22
Creates a pattern that paints with the content of surface.
Parameters
surface
Returns
Inherited from
createLinear()
staticcreateLinear(x0,y0,x1,y1):LinearPattern
Defined in: pattern.d.ts:16
Creates a linear gradient between (x0, y0) and (x1, y1); add stops with addColorStopRgba.
Parameters
x0
number
y0
number
x1
number
y1
number
Returns
LinearPattern
Inherited from
createMesh()
staticcreateMesh():MeshPattern
Defined in: pattern.d.ts:20
Creates an empty mesh gradient; describe its patches with the MeshPattern methods.
Returns
Inherited from
createRadial()
staticcreateRadial(cx0,cy0,radius0,cx1,cy1,radius1):RadialPattern
Defined in: pattern.d.ts:18
Creates a radial gradient between two circles; add stops with addColorStopRgba.
Parameters
cx0
number
cy0
number
radius0
number
cx1
number
cy1
number
radius1
number
Returns
Inherited from
createRgb()
staticcreateRgb(red,green,blue):Pattern
Defined in: pattern.d.ts:12
Creates an opaque solid-color pattern.
Parameters
red
number
green
number
blue
number
Returns
Inherited from
createRgba()
staticcreateRgba(red,green,blue,alpha):Pattern
Defined in: pattern.d.ts:14
Creates a translucent solid-color pattern.
Parameters
red
number
green
number
blue
number
alpha
number