Skip to content

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

Pattern.constructor

Properties

__type__

__type__: bigint

Defined in: pattern.d.ts:24

GType of CairoPattern, the boxed type this class is registered under.

Inherited from

Pattern.__type__

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

Pattern.addColorStopRgb


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

Pattern.addColorStopRgba


getColorStopCount()

getColorStopCount(): number

Defined in: pattern.d.ts:30

Returns how many color stops a gradient pattern has.

Returns

number

Inherited from

Pattern.getColorStopCount


getColorStopRgba()

getColorStopRgba(index): ColorStop

Defined in: pattern.d.ts:32

Returns the color stop at index of a gradient pattern.

Parameters

index

number

Returns

ColorStop

Inherited from

Pattern.getColorStopRgba


getExtend()

getExtend(): Extend

Defined in: pattern.d.ts:40

Returns how the pattern is extended outside its natural area.

Returns

Extend

Inherited from

Pattern.getExtend


getFilter()

getFilter(): Filter

Defined in: pattern.d.ts:44

Returns the filter used when the pattern is resampled.

Returns

Filter

Inherited from

Pattern.getFilter


getLinearPoints()

getLinearPoints(): LinearPoints

Defined in: pattern.d.ts:59

Returns the two end points of the gradient.

Returns

LinearPoints


getMatrix()

getMatrix(): Matrix

Defined in: pattern.d.ts:48

Returns the transformation from user space to pattern space.

Returns

Matrix

Inherited from

Pattern.getMatrix


getReferenceCount()

getReferenceCount(): number

Defined in: pattern.d.ts:52

Returns the reference count of the pattern.

Returns

number

Inherited from

Pattern.getReferenceCount


getRgba()

getRgba(): RgbaColor

Defined in: pattern.d.ts:34

Returns the color of a solid pattern.

Returns

RgbaColor

Inherited from

Pattern.getRgba


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

Surface

Inherited from

Pattern.getSurface


getType()

getType(): PatternType

Defined in: pattern.d.ts:50

Returns the kind of pattern this is.

Returns

PatternType

Inherited from

Pattern.getType


setExtend()

setExtend(extend): void

Defined in: pattern.d.ts:38

Sets how the pattern is extended outside its natural area.

Parameters

extend

Extend

Returns

void

Inherited from

Pattern.setExtend


setFilter()

setFilter(filter): void

Defined in: pattern.d.ts:42

Sets the filter used when the pattern is resampled.

Parameters

filter

Filter

Returns

void

Inherited from

Pattern.setFilter


setMatrix()

setMatrix(matrix): void

Defined in: pattern.d.ts:46

Sets the transformation from user space to pattern space.

Parameters

matrix

Matrix

Returns

void

Inherited from

Pattern.setMatrix


status()

status(): Status

Defined in: pattern.d.ts:36

Returns the error status of the pattern, Status.SUCCESS when it is usable.

Returns

Status

Inherited from

Pattern.status


createForSurface()

static createForSurface(surface): Pattern

Defined in: pattern.d.ts:22

Creates a pattern that paints with the content of surface.

Parameters

surface

Surface

Returns

Pattern

Inherited from

Pattern.createForSurface


createLinear()

static createLinear(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

Pattern.createLinear


createMesh()

static createMesh(): MeshPattern

Defined in: pattern.d.ts:20

Creates an empty mesh gradient; describe its patches with the MeshPattern methods.

Returns

MeshPattern

Inherited from

Pattern.createMesh


createRadial()

static createRadial(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

RadialPattern

Inherited from

Pattern.createRadial


createRgb()

static createRgb(red, green, blue): Pattern

Defined in: pattern.d.ts:12

Creates an opaque solid-color pattern.

Parameters

red

number

green

number

blue

number

Returns

Pattern

Inherited from

Pattern.createRgb


createRgba()

static createRgba(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

Returns

Pattern

Inherited from

Pattern.createRgba

Released under the MPL-2.0 License.