RadialGradient

Radial gradient implementation.

Represents a gradient that radiates from a center point outward in a circular or elliptical pattern.

Methods

public function addStop(ColorInterface $color, float $position): static
Parameters
NameTypeDefault
$color ColorInterface -
$position float -

circle

static
public static function circle(): RadialGradient

Create a new circular radial gradient instance.

ellipse

static
public static function ellipse(): RadialGradient

Create a new elliptical radial gradient instance.

public function getPosition(): string

Get the center position.

public function getShape(): string

Get the gradient shape.

public function getSize(): string

Get the gradient size keyword.

public function getStops(): array
public function getType(): string
public function interpolate(float $position): ColorInterface
Parameters
NameTypeDefault
$position float -
public function toCss(string $colorSpace): string
Parameters
NameTypeDefault
$colorSpace string null
public function withPosition(string $position): RadialGradient

Return a new instance with a different position.

Parameters
NameTypeDefault
$position string -
public function withShape(string $shape): RadialGradient

Return a new instance with a different shape.

Parameters
NameTypeDefault
$shape string -
public function withSize(string $size): RadialGradient

Return a new instance with a different size.

Parameters
NameTypeDefault
$size string -