ColorPicker is an input control used to select a XenoAtom.Terminal.UI.Color (RGB or RGBA).
Screenshot:
site/img/colorpicker.png(placeholder)
var color = new State<Color>(Color.RgbA(0x50, 0x9A, 0xF6, 0x88));
var picker = new ColorPicker()
.AllowAlpha(true)
.ShowPalette(true)
.Value(color);
The UI includes:
#RRGGBB or #RRGGBBAA when alpha is enabled)Theme.Scheme (or an explicit Palette)Use Palette to override the swatches displayed by the picker:
var picker = new ColorPicker()
.Palette(
Color.Rgb(0xF7, 0x5B, 0x72),
Color.Rgb(0x67, 0xAF, 0x34),
Color.Rgb(0x50, 0x9A, 0xF6));
null entries in the palette are treated as Color.Default.
HorizontalAlignment = Align.Stretch, VerticalAlignment = Align.StartColorPicker is styled through ColorPickerStyle:
picker.Style(new ColorPickerStyle
{
SwatchWidth = 18,
SwatchHeight = 9,
PaletteColumns = 10,
});