/// <summary> /// Update the source palettes for drawing. /// </summary> /// <param name="paletteBack">Palette source for the background.</param> /// <param name="paletteBorder">Palette source for the border.</param> /// <param name="paletteMetric">Palette source for the metric.</param> public virtual void SetPalettes(IPaletteBack paletteBack, IPaletteBorder paletteBorder, IPaletteMetric paletteMetric) { Debug.Assert(paletteBorder != null); Debug.Assert(paletteBack != null); // Use newly provided palettes _paletteBack = paletteBack; _paletteBackDraw.SetInherit(paletteBack); _paletteBackLight.Inherit = paletteBack; // If not using a forced override decorator, then just store the new border palette // otherwise we update the decorator with the palette as the new inheritance to use if (_borderForced == null) { _paletteBorder = paletteBorder; } else { _borderForced.SetInherit(paletteBorder); } _paletteMetric = paletteMetric; }
/// <summary> /// Update the source palette for drawing. /// </summary> /// <param name="palette">Palette source for drawing details.</param> public void SetPalettes(PaletteBorderEdge palette) { Debug.Assert(palette != null); // Inherit from the newly provided palette _palette = palette; _borderForced.SetInherit(palette); // Give the forced palette to the base base.SetPalettes(_borderForced); }