private static function parseRgbComponent($input, &$result)
    {
        if (preg_match('/^\\s*(\\d*(?:\\.\\d*)?)(%?)\\s*$/', $input, $matches)) {
            $result = floatval($matches[1]);
            
            if ($matches[2] === '%') {
                $result = 255 * $result / 100;
            }
            
            $result = (int)$result;
            
            if ($result < 0) $result = 0;
            if ($result > 255) $result = 255;
            
            return true;
        }
        return false;
    }