Apple News API PHP Client

LinearGradientFill
in package
implements FillInterface

FinalYes

Linear gradient background fill.

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

Table of Contents

Interfaces

FillInterface
Interface for all fill types.

Properties

$angle  : float|null
The gradient angle in degrees.
$colorStops  : array<int, ColorStop>
The color stops.

Methods

addColorStop()  : $this
Add a color stop.
addStop()  : $this
Add a color stop at a location.
diagonal()  : self
Create a diagonal gradient (top-left to bottom-right).
getType()  : string
Get the fill type identifier.
horizontal()  : self
Create a horizontal gradient (left to right).
jsonSerialize()  : array<string, mixed>
{@inheritdoc}
setAngle()  : $this
Set the gradient angle.
vertical()  : self
Create a vertical gradient (top to bottom).

Properties

Methods

addStop()

Add a color stop at a location.

public addStop(string $color, float $location) : $this
Parameters
$color : string

The color.

$location : float

The location (0-100).

Return values
$this

diagonal()

Create a diagonal gradient (top-left to bottom-right).

public static diagonal(string $startColor, string $endColor) : self
Parameters
$startColor : string

The start color.

$endColor : string

The end color.

Return values
self

A new instance.

getType()

Get the fill type identifier.

public getType() : string
Return values
string

The fill type.

horizontal()

Create a horizontal gradient (left to right).

public static horizontal(string $startColor, string $endColor) : self
Parameters
$startColor : string

The start color.

$endColor : string

The end color.

Return values
self

A new instance.

jsonSerialize()

{@inheritdoc}

public jsonSerialize() : array<string, mixed>
Return values
array<string, mixed>

setAngle()

Set the gradient angle.

public setAngle(float $angle) : $this
Parameters
$angle : float

The angle in degrees.

Return values
$this

vertical()

Create a vertical gradient (top to bottom).

public static vertical(string $startColor, string $endColor) : self
Parameters
$startColor : string

The start color.

$endColor : string

The end color.

Return values
self

A new instance.


        
On this page

Search results