Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/ColorPickerWPF/ColorPickRow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public ColorPickRow()
private void PickColorButton_OnClick(object sender, RoutedEventArgs e)
{
Color color;
if (ColorPickerWindow.ShowDialog(out color, Options))
if (ColorPickerWindow.ShowDialog(out color, seedColor: Color, flags: Options))
{
SetColor(color);
OnPick?.Invoke(this, EventArgs.Empty);
Expand Down
3 changes: 2 additions & 1 deletion src/ColorPickerWPF/ColorPickerWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,15 @@ public ColorPickerWindow()
InitializeComponent();
}

public static bool ShowDialog(out Color color, ColorPickerDialogOptions flags = ColorPickerDialogOptions.None, ColorPickerControl.ColorPickerChangeHandler customPreviewEventHandler = null)
public static bool ShowDialog(out Color color, Color? seedColor = null, ColorPickerDialogOptions flags = ColorPickerDialogOptions.None, ColorPickerControl.ColorPickerChangeHandler customPreviewEventHandler = null)
{
if ((flags & ColorPickerDialogOptions.LoadCustomPalette) == ColorPickerDialogOptions.LoadCustomPalette)
{
ColorPickerSettings.UsingCustomPalette = true;
}

var instance = new ColorPickerWindow();
instance.ColorPicker.SetColor(seedColor ?? Colors.White);
color = instance.ColorPicker.Color;

if ((flags & ColorPickerDialogOptions.SimpleView) == ColorPickerDialogOptions.SimpleView)
Expand Down