Source for file Color.php
Documentation is available at Color.php
* Validates a color according to the HTML spec.
public function validate($string, $config, $context) {
if ($colors ===
null) $colors =
$config->get('Core', 'ColorKeywords');
if (empty($string)) return false;
if (isset
($colors[$string])) return $colors[$string];
if ($string[0] ===
'#') $hex =
substr($string, 1);
if ($length !==
3 &&
$length !==
6) return false;
if ($length ===
3) $hex =
$hex[0].
$hex[0].
$hex[1].
$hex[1].
$hex[2].
$hex[2];
Documentation generated on Thu, 19 Jun 2008 18:48:55 -0400 by phpDocumentor 1.4.2