45 lines
1.2 KiB
PHP
45 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 = [
|
|
"basic" => [
|
|
["bgcolor" => "indianred", "color" => "firebrick"],
|
|
["bgcolor" => "lightblue", "color" => "blue"],
|
|
["bgcolor" => "peru", "color" => "maroon"],
|
|
["bgcolor" => "mediumaquamarine", "color" => "teal"],
|
|
["bgcolor" => "orange", "color" => "goldenrod"],
|
|
["bgcolor" => "limegreen", "color" => "green"],
|
|
["bgcolor" => "darkgrey", "color" => "grey"],
|
|
["bgcolor" => "darkyellow1", "color" => "darkyellow2"],
|
|
["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];
|
|
}
|
|
}
|