Example #1
0
        protected override Value Clone()
        {
            ColourUnit result = new ColourUnit();

            result.Values = CopyInnerValues();
            return(result);
        }
Example #2
0
        public override Value ReadStartValue(CssLexer lexer)
        {
            // Skip the hash:
            lexer.Read();

            if (lexer.SelectorMode)
            {
                // Just a hash (ID selector):
                return(new TextUnit("#"));
            }

            // Read the hex string now:
            string hex = lexer.ReadString();

            ColourUnit result = new ColourUnit();

            result.SetHex(hex);
            return(result);
        }