class IconSet

Draws the favicon, app icon and splash screen files from the data of one source image.

Every size is drawn from the source itself, never from a smaller copy, and a source is never enlarged: a size larger than the source is left out, or the source sits smaller in the middle of a larger canvas.

Constants

FAVICON_SIZES

FAVICON_PNG_SIZE

APP_ICON_MIN_SIZE

MASKABLE_SAFE_ZONE

Android crops a maskable icon to a shape of its choosing, keeping only a circle 80% of the icon's width, so the image is drawn inside it.

SPLASH_ICON_SIZE

Points across the app icon on a splash screen: the size the 80% safe zone of a 128-point maskable icon has on Android.

LARGEST_SCREEN

SCREEN_QUALITY

Methods

__construct( ImageManager $images)

No description

array
favicon(string $source)

No description

array
appIcon(string $source, string $background)

The home screen icons, and a favicon for forums that have no other.

string
splash(string $icon, int $width, int $height, int $ratio, string $background)

No description

string
screen(string $source)

No description

string
cover(string $image, int $width, int $height)

No description

int
longestSide(string $source)

No description

string
square(string $source, int $size, string|null $background = null, float $content = 1.0)

No description

string
png( ImageInterface $image)

No description

Details

__construct( ImageManager $images)

Parameters

ImageManager $images

array favicon(string $source)

Parameters

string $source

Return Value

array

array appIcon(string $source, string $background)

The home screen icons, and a favicon for forums that have no other.

Parameters

string $source
string $background

Return Value

array file name => contents

string splash(string $icon, int $width, int $height, int $ratio, string $background)

Parameters

string $icon
int $width
int $height
int $ratio
string $background

Return Value

string

string screen(string $source)

Parameters

string $source

Return Value

string

string cover(string $image, int $width, int $height)

Parameters

string $image
int $width
int $height

Return Value

string

int longestSide(string $source)

Parameters

string $source

Return Value

int

protected string square(string $source, int $size, string|null $background = null, float $content = 1.0)

Parameters

string $source
int $size
string|null $background
float $content

Return Value

string

protected string png( ImageInterface $image)

Parameters

ImageInterface $image

Return Value

string