Apple News API PHP Client

TextShadow
in package
implements JsonSerializable

FinalYes

Shadow effect for text.

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

Table of Contents

Interfaces

JsonSerializable

Properties

$color  : string|null
The shadow color.
$offset  : TextShadowOffset|null
The shadow offset.
$radius  : int|null
The blur radius.

Methods

dropShadow()  : self
Create a simple drop shadow.
jsonSerialize()  : array<string, mixed>
{@inheritdoc}
setColor()  : $this
Set the shadow color.
setOffset()  : $this
Set the shadow offset.
setOffsetXY()  : $this
Set the shadow offset using x/y values.
setRadius()  : $this
Set the blur radius.
subtle()  : self
Create a subtle shadow.

Properties

$color

The shadow color.

private string|null $color = null

$radius

The blur radius.

private int|null $radius = null

Methods

dropShadow()

Create a simple drop shadow.

public static dropShadow([string $color = '#00000066' ][, int $radius = 2 ][, float $x = 1 ][, float $y = 1 ]) : self
Parameters
$color : string = '#00000066'

The shadow color.

$radius : int = 2

The blur radius.

$x : float = 1

The horizontal offset.

$y : float = 1

The vertical offset.

Return values
self —

A new instance.

jsonSerialize()

{@inheritdoc}

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

setColor()

Set the shadow color.

public setColor(string $color) : $this
Parameters
$color : string

The color in hex format.

Return values
$this

setOffsetXY()

Set the shadow offset using x/y values.

public setOffsetXY(float $x, float $y) : $this
Parameters
$x : float

The horizontal offset.

$y : float

The vertical offset.

Return values
$this

setRadius()

Set the blur radius.

public setRadius(int $radius) : $this
Parameters
$radius : int

The radius in points.

Return values
$this

subtle()

Create a subtle shadow.

public static subtle() : self
Return values
self —

A new instance.


        
On this page

Search results