maaslalani / draw

Draw in your terminal
MIT License
466 stars 18 forks source link

Proposal: allow to type and draw numbers #11

Closed EricKotato closed 2 years ago

EricKotato commented 2 years ago

Is your feature request related to a problem? Please describe. Since color is currently selected by 1-9 keys, it's impossible to type these numbers as text or draw with them.

Describe the solution you'd like When pressing 1-9 key, it should be allowed to type them instead of changing color. Of course, a question arises: how to change color? I've did some tests, and keys Alt+1 up to Alt+9 worked fine for me, so I'm proposing to move color switching to them instead.

Here's how it could look:

case "alt+1", "alt+2", "alt+3", "alt+4", "alt+5", "alt+6", "alt+7", "alt+8", "alt+9":
    m.color = msg.String()[len(msg.String())-1:] // last symbol is number we need

Describe alternatives you've considered There are other ways to approach this:

maaslalani commented 2 years ago

Ah I wish I thought about this a little more and went with Alt+[1234] or Alt+[rbgy] for color picking instead of using simply the numbers but I figured that not many people would need the numbers to draw with since you can now type them out when in "insert" mode.

I think keeping the current way of color switching and adding the Alt+[1234] for switching the drawing character to a number is reasonable, I'd accept a PR for that change if you want to contribute to the project or I can add the changes myself, let me know :)

maaslalani commented 2 years ago

Also, thanks for the well-written + well-thought-out issue. I really appreciate it ❤️