コード例 #1
0
        public static ushort BackConsoleColorToAttribute(TvColor color)
        {
            switch (color.Value)
            {
            case TvColorNames.Black:
                return((ushort)0);

            case TvColorNames.Blue:
                return(BACKGROUND_BLUE);

            case TvColorNames.Cyan:
                return(BACKGROUND_BLUE | BACKGROUND_GREEN);

            case TvColorNames.Green:
                return(BACKGROUND_GREEN);

            case TvColorNames.Magenta:
                return(BACKGROUND_BLUE | BACKGROUND_RED);

            case TvColorNames.Red:
                return(BACKGROUND_RED);

            case TvColorNames.White:
                return(BACKGROUND_RED | BACKGROUND_GREEN | BACKGROUND_BLUE);

            case TvColorNames.Yellow:
                return(BACKGROUND_RED | BACKGROUND_GREEN);

            default:
                return(0);
            }
        }
コード例 #2
0
 public IListStyleProviderConditionBuilder <T> Use(TvColor fore, TvColor back)
 {
     _items.Add(new ListStyleProviderItem()
     {
         Back = back,
         Fore = fore
     });
     return(this);
 }
コード例 #3
0
ファイル: StyleBuilder.cs プロジェクト: eiximenis/tvision2
 public IStyleBuilder DesiredCustom(string name, TvColor fore, TvColor back,
                                    CharacterAttributeModifiers attributes = CharacterAttributeModifiers.Normal)
 {
     _customDefinitions.Add(name, new StyleDefinition()
     {
         Foreground = fore,
         Background = back,
         Attributes = attributes
     });
     return(this);
 }
コード例 #4
0
ファイル: StyleBuilder.cs プロジェクト: eiximenis/tvision2
 public IStyleBuilder DesiredAlternateFocused(TvColor fore, TvColor back,
                                              CharacterAttributeModifiers attributes = CharacterAttributeModifiers.Normal)
 {
     _alternateFocused = new StyleDefinition()
     {
         Foreground = fore,
         Background = back,
         Attributes = attributes
     };
     return(this);
 }
コード例 #5
0
 public CharacterAttribute BuildAttributeFor(TvColor fore, TvColor back,
                                             CharacterAttributeModifiers attrs = CharacterAttributeModifiers.Normal) => new CharacterAttribute()
 {
     ColorIdx  = (int)fore + ((int)back << 3),
     Modifiers = attrs
 };
コード例 #6
0
 public int GetPairIndexFor(TvColor fore, TvColor back) => (int)fore + ((int)back << 3);
コード例 #7
0
 public int GetPairIndexFor(TvColor fore, TvColor back)
 {
     throw new NotImplementedException();
 }
コード例 #8
0
 public CharacterAttribute BuildAttributeFor(TvColor fore, TvColor back,
                                             CharacterAttributeModifiers attrs = CharacterAttributeModifiers.Normal)
 {
     throw new NotImplementedException();
 }