Exemplo n.º 1
0
        public Colour4 GetColour(ThemeSlot slot)
        {
            if (colours.TryGetValue(slot, out Colour4 value))
            {
                return(value);
            }

            throw new ArgumentException($"{slot} does not exist in '{this}' theme.");
        }
Exemplo n.º 2
0
        /// <summary>
        /// Adds a colour to the colour mappings. If a slot is already defined, it will be overwritten.
        /// </summary>
        /// <param name="slot">The slot to add the colour to.</param>
        /// <param name="colour">The colour to set the slot's value to</param>
        /// <returns></returns>
        public Theme AddColour(ThemeSlot slot, Colour4 colour)
        {
            if (colours == null)
            {
                colours = new Dictionary <ThemeSlot, Colour4>();
            }

            if (colours.ContainsKey(slot))
            {
                colours[slot] = colour;
            }
            else
            {
                colours.Add(slot, colour);
            }

            return(this);
        }
Exemplo n.º 3
0
 protected override void UpdateBackground(ThemeSlot slot)
 => background.Colour = slot;
Exemplo n.º 4
0
 protected virtual void UpdateLabel(ThemeSlot slot)
 {
 }
Exemplo n.º 5
0
 protected virtual void UpdateBackground(ThemeSlot slot)
 {
 }
Exemplo n.º 6
0
 /// <summary>
 /// Adds a colour to the colour mappings. If a slot is already defined, it will be overwritten.
 /// </summary>
 /// </summary>
 /// <param name="slot">The slot to add the colour to.</param>
 /// <param name="hex">The colour represented as a valid hex string.</param>
 /// <returns></returns>
 public Theme AddColour(ThemeSlot slot, string hex)
 => AddColour(slot, Colour4.FromHex(hex));