Files
DomFramework/src/GraphPalette.php

41 lines
1.2 KiB
PHP

<?php
/** DomFramework
* @package domframework
* @author Dominique Fournier <dominique@fournier38.fr>
* @license BSD
*/
namespace Domframework;
/** The graphPalette class */
class GraphPalette
{
/** Get the complete palette
* @param string $name The palette name to get
*/
public static function getPalette($name)
{
$palette = array(
"basic" => array(
array("bgcolor" => "indianred", "color" => "firebrick"),
array("bgcolor" => "lightblue", "color" => "blue"),
array("bgcolor" => "peru", "color" => "maroon"),
array("bgcolor" => "mediumaquamarine", "color" => "teal"),
array("bgcolor" => "orange", "color" => "goldenrod"),
array("bgcolor" => "limegreen", "color" => "green"),
array("bgcolor" => "darkgrey", "color" => "grey"),
array("bgcolor" => "darkyellow1", "color" => "darkyellow2"),
array("bgcolor" => "grey", "color" => "black"),
),
);
if (! is_string($name) || ! array_key_exists($name, $palette)) {
throw new \Exception(dgettext(
"domframework",
"Unknown palette name provided"
), 406);
}
return $palette[$name];
}
}