![]() get_shape_override() - returns shape name associated with this mode (for OKHSL) returns "" by default, which doesn't change modeĪlpha would be available independently from other sliders, but you'd be able to specify its range by using SLIDER_ALPHA_IDX constant as slider idx in the relevant methods.Ĭolor modes RGB, HSV, WHATEVER would be defined using structs inheriting ColorMode that implement these methods.set_color(color) - used to set slider values from color.get_slider_gradient(idx) - returns the gradient for slider idx.get_slider_min(idx) - returns min value for the slider idx default is 0. ![]() ![]() get_slider_label(idx) - returns the label for slider idx.get_slider_count() - returns number of sliders (useful if we ever add CMYK or something) default impl returns 3.So the struct ColorMode would this set of methods (non-exhaustive): Each color mode differs in color rules and slider setup.Īnd each color mode has a set of rules how to construct color from slider values and vice versa. The easiest way to properly decouple color modes, that I can think of, is adding a struct called ColorMode. being able to add custom color modes via scripting (see implementation)ĭescribe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams.being able to select what color modes are supported per picker (e.g.Also switching to OKHSL color mode should automatically change shape if it's different. This would however require icons for each shape, as their names are too long. With the space saved by removing a button, we could probably add another button, for changing shapes. This way we can add infinite color modes and don't need to worry about space. Since all modes are exclusive, they could just be put under an OptionButton: It was ok when Raw was the only option, but now it needs to be changed. Describe the feature / enhancement and how it helps to overcome the problem or limitationĬolorPicker code should be refactored and cleaned up, to make multiple color modes more maintainable and easier to add.įirst, get rid of the CheckButtons. And in case of OKHSL mode, you are tied to a specific shape to be able to use it. Picker shape is a property in editor there is a setting for default shape, but you can change it only via the setting. Speaking of shapes, there's no easy way to change them at runtime. The OKHSL workarounds this by coupling the color mode with a special picker shape (lol). It has RGB, HSV and Raw move, but they never were properly separated, resulting in lots of spaghetti code, with OKHSL mode going to be added soon that adds even more messy code.Ĭolor modes are just two exclusive CheckButtons.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |