original_string: protected function coerceColor($value)
      {
          switch ($value[0]) {
              case Type::T_COLOR:
                  return $value;
  
              case Type::T_KEYWORD:
                  $name = strtolower($value[1]);
  
                  if (isset(Colors::$cssColors[$name])) {
                      $rgba = explode(',', Colors::$cssColors[$name]);
  
                      return isset($rgba[3])
                          ? [Type::T_COLOR, (int) $rgba[0], (int) $rgba[1], (int) $rgba[2], (int) $rgba[3]]
                          : [Type::T_COLOR, (int) $rgba[0], (int) $rgba[1], (int) $rgba[2]];
                  }
  
                  return null;
          }
  
          return null;
      }
code: protected function coerceColor($value)
      {
          switch ($value[0]) {
              case Type::T_COLOR:
                  return $value;
  
              case Type::T_KEYWORD:
                  $name = strtolower($value[1]);
  
                  if (isset(Colors::$cssColors[$name])) {
                      $rgba = explode(',', Colors::$cssColors[$name]);
  
                      return isset($rgba[3])
                          ? [Type::T_COLOR, (int) $rgba[0], (int) $rgba[1], (int) $rgba[2], (int) $rgba[3]]
                          : [Type::T_COLOR, (int) $rgba[0], (int) $rgba[1], (int) $rgba[2]];
                  }
  
                  return null;
          }
  
          return null;
      }
code_tokens: protected function coerceColor ( $ value ) { switch ( $ value [ 0 ] ) { case Type :: T_COLOR : return $ value ; case Type :: T_KEYWORD : $ name = strtolower ( $ value [ 1 ] ) ; if ( isset ( Colors :: $ cssColors [ $ name ] ) ) { $ rgba = explode ( ',' , Colors :: $ cssColors [ $ name ] ) ; return isset ( $ rgba [ 3 ] ) ? [ Type :: T_COLOR , ( int ) $ rgba [ 0 ] , ( int ) $ rgba [ 1 ] , ( int ) $ rgba [ 2 ] , ( int ) $ rgba [ 3 ] ] : [ Type :: T_COLOR , ( int ) $ rgba [ 0 ] , ( int ) $ rgba [ 1 ] , ( int ) $ rgba [ 2 ] ] ; } return null ; } return null ; }
docstring: Coerce value to color
  
  @param array $value
  
  @return array|null
docstring_tokens: Coerce value to color