예제 #1
0
        private CharAttributes GetCharAttributes()
        {
            var attributes = new CharAttributes();

            for (int i = 0; i < _params.Count; i++)
            {
                int p = (int)_params[i];
                if (p >= 30 && p <= 37)
                {
                    // fg color 8
                    attributes.ForegroundColour = p - 30;
                }
                else if (p >= 40 && p <= 47)
                {
                    // bg color 8
                    attributes.BackgroundColour = p - 40;
                }
                else if (p >= 90 && p <= 97)
                {
                    // fg color 16
                    p += 8;
                    attributes.ForegroundColour = p - 90;
                }
                else if (p == 0)
                {
                    attributes.Flags            = 0;
                    attributes.ForegroundColour = 0;
                    attributes.BackgroundColour = 0;
                }
                else if (p == 1)
                {
                    attributes.Flags |= 1;
                }
                else
                {
                }
            }
            return(attributes);
        }
예제 #2
0
 public TerminalCode(TerminalCodeType type, CharAttributes charAttributes) : this(type)
 {
     CharAttributes = charAttributes;
 }