PHP code example of tobimori / kirby-color-palette

1. Go to this page and download the library: Download tobimori/kirby-color-palette 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/ */

    

tobimori / kirby-color-palette example snippets


$selected = $page->palette();   #(Field object)
$selected = $selected->value(); #(string)

$palette    = $page->palette()->yaml();
$background = $palette['background']; #(string)
$border     = $palette['border']; #(string)

$border     = $palette['key']; #(string)

$palette  = $page->palette()->yaml();
$selected = $palette[0]; #selected color (string)
$palette  = $palette[1]; #extracted palette (array)