Apple News API PHP Client

ColorStop
in package
implements JsonSerializable

FinalYes

Color stop for gradient fills.

Tags
see
https://developer.apple.com/documentation/apple_news/colorstop

Table of Contents

Interfaces

JsonSerializable

Properties

$color  : string
$location  : float

Methods

__construct()  : mixed
Create a new ColorStop.
at()  : self
Create a color stop.
jsonSerialize()  : array{color: string, location: float}
{@inheritdoc}

Properties

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}
Return values
array{color: string, location: float}

        
On this page

Search results