PHP code example of phpcolor / apple-colors

1. Go to this page and download the library: Download phpcolor/apple-colors library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

phpcolor / apple-colors example snippets


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();

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();

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'

use PhpColor\Colors\Apple\AppleColors as Apple;

$colors = Apple::macOS();

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