You are here

private static function Kint_Parsers_Color::_fits in Devel 8.2

Same name and namespace in other branches
  1. 8 kint/kint/parsers/custom/color.php \Kint_Parsers_Color::_fits()
1 call to Kint_Parsers_Color::_fits()
Kint_Parsers_Color::_parse in kint/kint/parsers/custom/color.php
* main and usually single method a custom parser must implement * *

File

kint/kint/parsers/custom/color.php, line 56

Class

Kint_Parsers_Color

Code

private static function _fits($variable) {
  if (!is_string($variable)) {
    return false;
  }
  $var = strtolower(trim($variable));
  return isset(self::$_css3Named[$var]) || preg_match('/^(?:#[0-9A-Fa-f]{3}|#[0-9A-Fa-f]{6}|(?:rgb|hsl)a?\\s*\\((?:\\s*[0-9.%]+\\s*,?){3,4}\\))$/', $var);
}