Skip to content

ColorBar Class

A color bar control.

C#
public class ColorBar : ControlBase

Inheritance objectControlBase

Creates a new color bar with the specified width.

C#
public ColorBar(int width)

width int
The width of the bar.

Internal use by theme.

C#
public int _positions

Internal use by theme.

C#
public Color[] _colorSteps

Gets or sets the color on the left-side of the bar.

C#
public Color StartingColor { get; set; }

Gets or sets the color on the right-side of the bar.

C#
public Color EndingColor { get; set; }

The selected color.

C#
public Color SelectedColor { get; set; }

The position on the bar currently selected.

C#
public int SelectedPosition { get; }

Called as the mouse moves around the control area. Raises the MouseMove event and calls the DetermineState() method.

C#
protected override void OnMouseIn(ControlBase.ControlMouseState info)

info ControlBase.ControlMouseState

Checks if the mouse is the control and calls the appropriate mouse methods.

C#
public override bool ProcessMouse(MouseScreenObjectState info)

info MouseScreenObjectState

bool
True when the control is enabled, set to use the mouse and the mouse is over it, otherwise false.

Redraws the control if applicable.

C#
public override void UpdateAndRedraw(TimeSpan time)

time TimeSpan
The duration of thecurrent frame.

Raised when the SelectedColor value changes.

C#
public event EventHandler? ColorChanged

EventHandler