public PaletteItem(PaletteItemType type, Color color) { this._ItemType = type; this._Color = color; this._Pen = null; this._Brush = null; }
/// <summary> /// Returns color for specified type, created by morphing Base color and Morph color and ratio for this type. /// </summary> /// <param name="type"></param> /// <returns></returns> public Color this[PaletteItemType type] { get { switch (type) { case PaletteItemType.WorkspaceBack: return(this.WorkspaceBack); case PaletteItemType.ButtonBackDisable: return(this.ButtonBack.Morph(this.MorphDisableBack, this.MorphDisableRatio)); case PaletteItemType.ButtonForeDisable: return(this.ButtonFore.Morph(this.MorphDisableFore, this.MorphDisableRatio)); case PaletteItemType.ButtonBackEnable: return(this.ButtonBack); case PaletteItemType.ButtonForeEnable: return(this.ButtonFore); case PaletteItemType.ButtonBackHot: return(this.ButtonBack.Morph(this.MorphHotBack, this.MorphHotRatio)); case PaletteItemType.ButtonForeHot: return(this.ButtonFore.Morph(this.MorphHotFore, this.MorphHotRatio)); case PaletteItemType.ButtonBackDown: return(this.ButtonBack.Morph(this.MorphDownBack, this.MorphDownRatio)); case PaletteItemType.ButtonForeDown: return(this.ButtonFore.Morph(this.MorphDownFore, this.MorphDownRatio)); case PaletteItemType.ScrollBarBackDisable: return(this.ScrollBarBack.Morph(this.MorphDisableBack, this.MorphDisableRatio)); case PaletteItemType.ScrollBarForeDisable: return(this.ScrollBarFore.Morph(this.MorphDisableFore, this.MorphDisableRatio)); case PaletteItemType.ScrollBarBackEnable: return(this.ScrollBarBack); case PaletteItemType.ScrollBarForeEnable: return(this.ScrollBarFore); case PaletteItemType.ScrollBarBackHot: return(this.ScrollBarBack.Morph(this.MorphHotBack, this.MorphHotRatio)); case PaletteItemType.ScrollBarForeHot: return(this.ScrollBarFore.Morph(this.MorphHotFore, this.MorphHotRatio)); case PaletteItemType.ScrollBarBackDown: return(this.ScrollBarBack.Morph(this.MorphDownBack, this.MorphDownRatio)); case PaletteItemType.ScrollBarForeDown: return(this.ScrollBarFore.Morph(this.MorphDownFore, this.MorphDownRatio)); case PaletteItemType.AxisBackDisable: return(this.AxisBack.Morph(this.MorphDisableBack, this.MorphDisableRatio)); case PaletteItemType.AxisForeDisable: return(this.AxisFore.Morph(this.MorphDisableFore, this.MorphDisableRatio)); case PaletteItemType.AxisBackEnable: return(this.AxisBack); case PaletteItemType.AxisForeEnable: return(this.AxisFore); case PaletteItemType.AxisBackHot: return(this.AxisBack.Morph(this.MorphHotBack, this.MorphHotRatio)); case PaletteItemType.AxisForeHot: return(this.AxisFore.Morph(this.MorphHotFore, this.MorphHotRatio)); case PaletteItemType.AxisBackDown: return(this.AxisBack.Morph(this.MorphDownBack, this.MorphDownRatio)); case PaletteItemType.AxisForeDown: return(this.AxisFore.Morph(this.MorphDownFore, this.MorphDownRatio)); } return(Color.Gray); } }
public PaletteSet(PaletteItemType backDisable, PaletteItemType foreDisable, PaletteItemType backEnable, PaletteItemType foreEnable, PaletteItemType backHot, PaletteItemType foreHot, PaletteItemType backDown, PaletteItemType foreDown) { this.BackDisable = new PaletteItem(backDisable); this.ForeDisable = new PaletteItem(foreDisable); this.BackEnable = new PaletteItem(backEnable); this.ForeEnable = new PaletteItem(foreEnable); this.BackHot = new PaletteItem(backHot); this.ForeHot = new PaletteItem(foreHot); this.BackDown = new PaletteItem(backDown); this.ForeDown = new PaletteItem(foreDown); }
private static Color _GetColorForType(PaletteItemType type, PaletteBaseColors baseColors, Dictionary <PaletteItemType, Color> userTable) { Color color; if (userTable != null && userTable.TryGetValue(type, out color)) { return(color); } if (baseColors != null) { return(baseColors[type]); } return(Color.Gray); }
private void _Initialise(PaletteSkinType skin, PaletteBaseColors baseColors, Dictionary <PaletteItemType, Color> userTable) { this._Clear(); Array types = Enum.GetValues(typeof(PaletteItemType)); foreach (object item in types) { PaletteItemType type = (PaletteItemType)item; Color color = _GetColorForType(type, baseColors, userTable); this._PaletteItems.Add(type, new PaletteItem(type, color)); } this._Skin = skin; this._BaseColors = baseColors; }
public PaletteItem(PaletteItemType itemType) { this.ItemType = itemType; }
// ... #endregion #region Public SolidBrushes public static Brush BrushFor(PaletteItemType itemType) { return(Current._PaletteItems[itemType].Brush); }
// ... #endregion #region Public Pens public static Pen PenFor(PaletteItemType itemType) { return(Current._PaletteItems[itemType].Pen); }
public static Color ColorFor(PaletteItemType itemType) { return(Current._PaletteItems[itemType].Color); }