Example #1
0
        public static string Highlight(object Value, Color c)
        {
            var v            = Value.ToString();
            int indexOfReset = v.LastIndexOf(ANSIAPI.Reset);

            if (indexOfReset >= 0)
            {
                v = v.Insert(indexOfReset + ANSIAPI.Reset.Length - 1, ANSIAPI.Color24bit(c.Red, c.Green, c.Blue, true));
            }

            return(ANSIAPI.Color24bit(c.Red, c.Green, c.Blue, true) + v + ANSIAPI.Reset);
        }
Example #2
0
        public static string Style(object Value, Style s)
        {
            var v            = Value.ToString();
            int indexOfReset = v.LastIndexOf(ANSIAPI.Reset);

            var d = (Decoration)(int)s;

            if (indexOfReset >= 0)
            {
                v = v.Insert(indexOfReset + ANSIAPI.Reset.Length - 1, ANSIAPI.Decoration(d));
            }

            return(ANSIAPI.Decoration(d) + v + ANSIAPI.Reset);
        }