ColorStop
in package
implements
JsonSerializable
FinalYes
Color stop for gradient fills.
Tags
Table of Contents
Interfaces
- JsonSerializable
Properties
Methods
- __construct() : mixed
- Create a new ColorStop.
- at() : self
- Create a color stop.
- jsonSerialize() : array{color: string, location: float}
- {@inheritdoc}
Properties
$color read-only
private
string
$color
$location read-only
private
float
$location
Methods
__construct()
Create a new ColorStop.
public
__construct(string $color, float $location) : mixed
Parameters
- $color : string
-
The color in hex format.
- $location : float
-
The location (0.0 to 100.0 as percentage).
at()
Create a color stop.
public
static at(string $color, float $location) : self
Parameters
- $color : string
-
The color.
- $location : float
-
The location percentage (0-100).
Return values
self —A new instance.
jsonSerialize()
{@inheritdoc}
public
jsonSerialize() : array{color: string, location: float}