foo_spider_monkey_panel
foo_spider_monkey_panel copied to clipboard
ColourPicker does not differentiate cancelling and selecting a color
https://theqwertiest.github.io/foo_spider_monkey_panel/assets/generated_files/docs/html/js_foo_spider_monkey_panel.js.html#line1495
Contrary to the InputBox method, cancelling always return a color. That limits the popup handling since there is no way to differentiate between these 2 cases:
- User canceled the popup because they didn't want any color (i.e. no change). Default color is applied.
- User selected the default color on purpose.
InputBox has an error on cancel option, which allows to differentiate those situations. Current design assumes a color is always used, which may be not true in all cases. Due to this design, most scripts I have seen have to expose 2 settings for the final user: (making it more complex than needed).
- One to set a custom color (for ex. a background).
- Another to use the custom color set.
This is because as soon as a user calls the 1st menu, a color is always set...
Suggestion:
ColourPicker(window_id, default_colour, error_on_cancelopt)