public static Color GetColourFromTheme(ThemeColour colour) { switch (colour) { case ThemeColour.Clickable: return(Color.FromArgb(255, 47, 62, 77)); case ThemeColour.DarkBlue: return(Color.FromArgb(255, 41, 128, 185)); case ThemeColour.LightBlue: return(Color.FromArgb(255, 52, 152, 219)); case ThemeColour.DrumbleBlue: return(Color.FromArgb(255, 0, 174, 255)); case ThemeColour.Black: return(Color.FromArgb(255, 0, 0, 0)); case ThemeColour.White: return(Color.FromArgb(255, 255, 255, 255)); default: return(Color.FromArgb(255, 255, 255, 255)); } }
public static Color GetColourFromTheme(ThemeColour colour) { switch (colour) { case ThemeColour.Clickable: return Color.FromArgb(255, 47, 62, 77); case ThemeColour.DarkBlue: return Color.FromArgb(255, 41, 128, 185); case ThemeColour.LightBlue: return Color.FromArgb(255, 52, 152, 219); case ThemeColour.DrumbleBlue: return Color.FromArgb(255, 0, 174, 255); case ThemeColour.Black: return Color.FromArgb(255, 0, 0, 0); case ThemeColour.White: return Color.FromArgb(255, 255, 255, 255); default: return Color.FromArgb(255, 255, 255, 255); } }
/// <summary> /// Initializes the Page /// </summary> protected override void Init() { base.Init(); MenuAnchor aLeft = new MenuAnchor() { anchor = new Vector2(0.5f, 0), offset = new Vector2(-105, 200), offset_button = new Vector2(0, 50) }, aRight = new MenuAnchor() { anchor = new Vector2(0.5f, 0), offset = new Vector2(105, 200), offset_button = new Vector2(0, 50) }, aCentre = new MenuAnchor() { anchor = new Vector2(0.5f, 0f), offset = new Vector2(0f, 200f), offset_button = new Vector2(0f, 50f) }; anchors.AddRange(new List<MenuAnchor>() { aLeft, aRight, aCentre }); buttons.Add(new MenuButton(0, "Accent colour:", "", "", () => { }).With(mb => { mb.canMouseOver = false; mb.SetAutomaticPosition(aLeft, 0); mb.Update += () => mb.colorText = ColourAccent; })); buttons.Add(new Image(MctUI.WhitePixel) { Scale = new Vector2(24f), IsButton = true, size = new Vector2(40f) / 24f, colorText = FromAccentEnum(AccentColour.Cobalt), description = "Cobalt" } .With(mb => { mb.SetAutomaticPosition(aLeft, 1); mb.Click += () => AccentColour = AccentColour.Cobalt; })); buttons.Add(new Image(MctUI.WhitePixel) { Scale = new Vector2(24f), IsButton = true, size = new Vector2(40f) / 24f, colorText = FromAccentEnum(AccentColour.Lime), description = "Lime" } .With(mb => { mb.SetAutomaticPosition(aLeft, 2); mb.Click += () => AccentColour = AccentColour.Lime; })); buttons.Add(new Image(MctUI.WhitePixel) { Scale = new Vector2(24f), IsButton = true, size = new Vector2(40f) / 24f, colorText = FromAccentEnum(AccentColour.OrangeRed), description = "Orange-red" } .With(mb => { mb.SetAutomaticPosition(aLeft, 3); mb.Click += () => AccentColour = AccentColour.OrangeRed; })); // --- buttons.Add(new MenuButton(0, "Theme colour:", "", "", () => { }).With(mb => { mb.canMouseOver = false; mb.SetAutomaticPosition(aRight, 0); mb.Update += () => mb.colorText = ColourAccent; })); buttons.Add(new Image(MctUI.WhitePixel) { Scale = new Vector2(24f), IsButton = true, size = new Vector2(40f) / 24f, colorText = FromThemeEnum(ThemeColour.Black), description = "Black" } .With((mb) => { mb.SetAutomaticPosition(aRight, 1); mb.Click += () => ThemeColour = ThemeColour.Black; })); buttons.Add(new Image(MctUI.WhitePixel) { Scale = new Vector2(24f), IsButton = true, size = new Vector2(40f) / 24f, colorText = FromThemeEnum(ThemeColour.White), description = "White" } .With((mb) => { mb.SetAutomaticPosition(aRight, 2); mb.Click += () => ThemeColour = ThemeColour.White; })); // --- buttons.Add(new MenuButton(0, "Back", "Options").Where(mb => mb.SetAutomaticPosition(aCentre, 4))); }
public static Color FromThemeEnum(ThemeColour theme) { return theme == ThemeColour.Black ? Black : Color.White; }
public static SolidColorBrush GetBrushFromTheme(ThemeColour colour) { return new SolidColorBrush(GetColourFromTheme(colour)); }
public static SolidColorBrush GetBrushFromTheme(ThemeColour colour) { return(new SolidColorBrush(GetColourFromTheme(colour))); }
public Colour4 Get(ThemeColour name) => colours.GetValueOrDefault(name);