using System;
using bs;
namespace bs.Editor
{
partial class GUIColorGradientField
{
///
/// Triggered when the gradient in the field changes.
///
public event Action OnChanged;
///
/// Callback triggered when the user clicks on the GUI element.
///
partial void Callback_OnClicked()
{
GradientPicker.Show(Value, (success, colorGradient) =>
{
if (!success)
return;
Value = colorGradient;
OnChanged?.Invoke(colorGradient);
});
}
}
partial class GUIColorGradientHDRField
{
///
/// Triggered when the gradient in the field changes.
///
public event Action OnChanged;
///
/// Callback triggered when the user clicks on the GUI element.
///
partial void Callback_OnClicked()
{
// Note: Should allow HDR color gradient
ColorGradient gradient = new ColorGradient(Value.GetKeys());
GradientPicker.Show(gradient, (success, colorGradient) =>
{
if (!success)
return;
Value = new ColorGradientHDR(colorGradient.GetKeys());
OnChanged?.Invoke(Value);
});
}
}
}