Considerations sketch-mode color-picker usecase #165
dalanicolai
started this conversation in
Ideas
Replies: 1 comment
-
#160, #162 and #165 are related, and concern https://github.com/dalanicolai/sketch-mode. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am thinking about how to enhance the color-picker in the sketch-mode package. I am opening this 'discussion' because I think it might be 'useful/interesting' for you when developing/extending the transient package. Again, there is no priority about anything, it is just sharing some thoughts/current limits I encounter with the transient package, and I hope it will be informative.
Currently, sketch-mode simply uses the
read-color
command for selecting colors, however this command does not provide a very nice overview of the colors, and it is also not friendly for selecting by mouse (which is used anyway already for drawing).I would like to present the user a set of clickable 'text-property-buttons' or 'svg-icons/buttons' of all (or a selection) of available colors.
I would prefer to show the
color-toolbars
permanently, but when showing them outside the transient buffer, then currently I think there is no goodAPI
to set the 'arguments' within the transient from 'outside'. (A possible solution was to make the current 'transient arguments' local variables, and use them in the transient, so that is why I created that lisp variable suffix class. I think it would be great if transient has more 'lisp-variable' classes so that it can be used in general Emacs packages (just sharing my 'enthusiasm' for that idea, it is in no way revolutionary of course).As an alternative I could present the buttons directly behind an infix in the transient, but I think there currently is no support for it. I could list the buttons (which are just text with button (text-)properties), and a color could be selected by clicking them. When I meant no support, I think the current
transient-format-value
does not support the use of buttons. Of course presenting the values as clickable buttons, would give/improve mouse support of transient.)Another alternative, would be that I could add a suffix (like currently on keybinding
c
), and then it will open another prefix where the color buttons are presented. For that case I just need to be able to get an 'empty' prefix buffer, where I can add the buttons myself (and which would have access to the transient arguments. Although, I did not yet look into that option, I expect it will be hard to for me to achieve that currently.)A final alternative, that I am thinking about now, is to create another
color-picker
'read-method' that would present the buttons in some child-frame. This is probably the 'easiest' option for me currently, but also it is the least ideal option.Anyway, I hope that while you are extending transient, that any of these use cases will be informative and that at some point any of these could be supported.
Of course, if you have a useful suggestion for me already (or maybe one of the above options is already available), then I would be happy to know about it. Anyway, thanks already (also for your answers in the other discussions)!
Beta Was this translation helpful? Give feedback.
All reactions