private static byte?CoerceBlue(IAvaloniaObject arg1, byte?arg2) { if (arg2 is null) { return(null); } return(ColorPickerHelpers.Clamp(arg2.Value, 0, 255)); }
private static bool ValidateHex(string?hex) { if (hex is null) { return(true); } if (!ColorPickerHelpers.IsValidHexColor(hex)) { throw new ArgumentException("Invalid Hex value."); } return(true); }
private static double?CoerceBlackKey(IAvaloniaObject arg1, double?arg2) { if (arg2 is null) { return(null); } if (double.IsNaN(arg2.Value)) { return(0.0); } return(ColorPickerHelpers.Clamp(arg2.Value, 0.0, 100.0)); }