protected LexicalUnit hexcolorInternal(final LexicalUnit prev, final Token t) {
        // Step past the hash at the beginning
        final int i = 1;
        int r = 0;
        int g = 0;
        int b = 0;
        final int len = t.image.length() - 1;
        try {
            if (len == 3) {
                r = Integer.parseInt(t.image.substring(i + 0, i + 1), 16);
                g = Integer.parseInt(t.image.substring(i + 1, i + 2), 16);
                b = Integer.parseInt(t.image.substring(i + 2, i + 3), 16);
                r = (r << 4) | r;
                g = (g << 4) | g;
                b = (b << 4) | b;
            }
            else if (len == 6) {
                r = Integer.parseInt(t.image.substring(i + 0, i + 2), 16);
                g = Integer.parseInt(t.image.substring(i + 2, i + 4), 16);
                b = Integer.parseInt(t.image.substring(i + 4, i + 6), 16);
            }
            else {
                final String pattern = getParserMessage("invalidColor");
                throw new CSSParseException(MessageFormat.format(
                    pattern, new Object[] {t}),
                    getInputSource().getURI(), t.beginLine,
                    t.beginColumn);
            }

            // Turn into an "rgb()"
            final LexicalUnit lr = LexicalUnitImpl.createNumber(null, r);
            final LexicalUnit lc1 = LexicalUnitImpl.createComma(lr);
            final LexicalUnit lg = LexicalUnitImpl.createNumber(lc1, g);
            final LexicalUnit lc2 = LexicalUnitImpl.createComma(lg);
            LexicalUnitImpl.createNumber(lc2, b);

            return LexicalUnitImpl.createRgbColor(prev, lr);
        }
        catch (final NumberFormatException ex) {
            final String pattern = getParserMessage("invalidColor");
            throw new CSSParseException(MessageFormat.format(
                pattern, new Object[] {t}),
                getInputSource().getURI(), t.beginLine,
                t.beginColumn, ex);
        }
    }
protected LexicalUnit hexcolorInternal ( final LexicalUnit prev , final Token t ) { final int i = 1 ; int r = 0 ; int g = 0 ; int b = 0 ; final int len = t . image . length ( ) - 1 ; try { if ( len == 3 ) { r = Integer . parseInt ( t . image . substring ( i + 0 , i + 1 ) , 16 ) ; g = Integer . parseInt ( t . image . substring ( i + 1 , i + 2 ) , 16 ) ; b = Integer . parseInt ( t . image . substring ( i + 2 , i + 3 ) , 16 ) ; r = ( r << 4 ) | r ; g = ( g << 4 ) | g ; b = ( b << 4 ) | b ; } else if ( len == 6 ) { r = Integer . parseInt ( t . image . substring ( i + 0 , i + 2 ) , 16 ) ; g = Integer . parseInt ( t . image . substring ( i + 2 , i + 4 ) , 16 ) ; b = Integer . parseInt ( t . image . substring ( i + 4 , i + 6 ) , 16 ) ; } else { final String pattern = getParserMessage ( "invalidColor" ) ; throw new CSSParseException ( MessageFormat . format ( pattern , new Object [ ] { t } ) , getInputSource ( ) . getURI ( ) , t . beginLine , t . beginColumn ) ; } final LexicalUnit lr = LexicalUnitImpl . createNumber ( null , r ) ; final LexicalUnit lc1 = LexicalUnitImpl . createComma ( lr ) ; final LexicalUnit lg = LexicalUnitImpl . createNumber ( lc1 , g ) ; final LexicalUnit lc2 = LexicalUnitImpl . createComma ( lg ) ; LexicalUnitImpl . createNumber ( lc2 , b ) ; return LexicalUnitImpl . createRgbColor ( prev , lr ) ; } catch ( final NumberFormatException ex ) { final String pattern = getParserMessage ( "invalidColor" ) ; throw new CSSParseException ( MessageFormat . format ( pattern , new Object [ ] { t } ) , getInputSource ( ) . getURI ( ) , t . beginLine , t . beginColumn , ex ) ; } }
Processes a hexadecimal color definition.

@param prev the previous lexical unit
@param t the token
@return a new lexical unit