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); } }
public IListStyleProviderConditionBuilder <T> Use(TvColor fore, TvColor back) { _items.Add(new ListStyleProviderItem() { Back = back, Fore = fore }); return(this); }
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); }
public IStyleBuilder DesiredAlternateFocused(TvColor fore, TvColor back, CharacterAttributeModifiers attributes = CharacterAttributeModifiers.Normal) { _alternateFocused = new StyleDefinition() { Foreground = fore, Background = back, Attributes = attributes }; return(this); }
public CharacterAttribute BuildAttributeFor(TvColor fore, TvColor back, CharacterAttributeModifiers attrs = CharacterAttributeModifiers.Normal) => new CharacterAttribute() { ColorIdx = (int)fore + ((int)back << 3), Modifiers = attrs };
public int GetPairIndexFor(TvColor fore, TvColor back) => (int)fore + ((int)back << 3);
public int GetPairIndexFor(TvColor fore, TvColor back) { throw new NotImplementedException(); }
public CharacterAttribute BuildAttributeFor(TvColor fore, TvColor back, CharacterAttributeModifiers attrs = CharacterAttributeModifiers.Normal) { throw new NotImplementedException(); }