ColorPicker Class
Definition
Section titled “Definition”Displays a rectangle gradient area between SadRogue.Primitives.Color.Black and a target color, and SadRogue.Primitives.Color.White and a target color.
public class ColorPicker : ControlBaseInheritance object → ControlBase
Constructors
Section titled “Constructors”ColorPicker(int, int, Color)
Section titled “ColorPicker(int, int, Color)”Creates a new panel with the specified width, height, and master color.
public ColorPicker(int width, int height, Color color)Parameters
Section titled “Parameters”width int
height int
color SadRogue.Primitives.Color
Properties
Section titled “Properties”SelectedColor
Section titled “SelectedColor”The color selected by the user. A shade of MasterColor.
public Color SelectedColor { get; }MasterColor
Section titled “MasterColor”The main color being shown that all gradients are generated from.
public Color MasterColor { get; set; }Methods
Section titled “Methods”OnMouseIn(ControlMouseState)
Section titled “OnMouseIn(ControlMouseState)”Called as the mouse moves around the control area. Raises the MouseMove event and calls the DetermineState() method.
protected override void OnMouseIn(ControlBase.ControlMouseState info)Parameters
Section titled “Parameters”info ControlBase.ControlMouseState
ProcessMouse(MouseScreenObjectState)
Section titled “ProcessMouse(MouseScreenObjectState)”Checks if the mouse is the control and calls the appropriate mouse methods.
public override bool ProcessMouse(MouseScreenObjectState info)Parameters
Section titled “Parameters”Returns
Section titled “Returns”bool
True when the control is enabled, set to use the mouse and the mouse is over it, otherwise false.
UpdateAndRedraw(TimeSpan)
Section titled “UpdateAndRedraw(TimeSpan)”Redraws the control if applicable.
public override void UpdateAndRedraw(TimeSpan time)Parameters
Section titled “Parameters”time TimeSpan
The duration of thecurrent frame.
Events
Section titled “Events”SelectedColorChanged
Section titled “SelectedColorChanged”Raised when SelectedColor changes value.
public event EventHandler? SelectedColorChanged