Skip to content

Latest commit

 

History

11 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Apple Colors

This package provides access to the color palettes used in Apple interfaces.

Apple Colors

Installation

composer require phpcolor/apple-colors:^1.0

The package works standalone. Install phpcolor/phpcolor only when using palette():

composer require phpcolor/phpcolor

Usage

Color Palettes

use PhpColor\Colors\Apple\AppleColors as Apple;

$colors = Apple::iOS();
$colors = Apple::iPadOS();
$colors = Apple::macOS();
$colors = Apple::tvOS();
$colors = Apple::visionOS();
$colors = Apple::watchOS();

Themes

use PhpColor\Colors\Apple\AppleColors as Apple;

$colors = Apple::macOS('light');
$colors = Apple::macOS('dark');

$colors = Apple::iOS('light');
$colors = Apple::iOS('dark');

// visionOS has only one theme
$colors = Apple::visionOS();

Color names

use PhpColor\Colors\Apple\AppleColors as Apple;

$colors = Apple::watchOS();

$names = $colors->getNames(); 
// 'red', 'orange', 'yellow', 'green', 'mint', 'teal', 'cyan',
// 'blue', 'indigo', 'purple', 'pink', 'brown', 'gray'

Color values

use PhpColor\Colors\Apple\AppleColors as Apple;

$colors = Apple::macOS();

echo $colors->blue;             // #007AFF
echo $colors->get('indigo');    // #5856D6

PHPColor palette

use PhpColor\Color\Palette\ColorPaletteInterface;
use PhpColor\Colors\Apple\AppleColors as Apple;

$palette = Apple::iOS()->palette();
assert($palette instanceof ColorPaletteInterface);

echo $palette->get('blue')->toHex(); // #007aff

Calling palette() without phpcolor/phpcolor installed throws a LogicException with the installation command.


Apple Colors

Credits

The colors listed in this project are based on the colors used by Apple.

License

This PHPColor package is released under the MIT license.

About

Color palettes used in Apple interfaces

Topics

Resources

Code of conduct

Security policy

Stars

3 stars

Watchers

0 watching

Forks

Releases

Used by

Contributors

Languages