Brushshe icon indicating copy to clipboard operation
Brushshe copied to clipboard

Add support for drawing with RGBA colors

Open limafresh opened this issue 8 months ago • 15 comments

limafresh avatar Mar 29 '26 17:03 limafresh

Taking a look at the codebase before I say I'll be responsible, but looking at this

pretty-weed avatar May 28 '26 22:05 pretty-weed

but looking at this

Something wrong?

If something is unclear, ask.

limafresh avatar May 29 '26 17:05 limafresh

Just don't know anything about the code, coming up with questions as I go.

so far:

  • what does the bh prefix mean? Can't find an explanation, is it short for brushshe?
  • unrelated to this ticket, but a way that I'll often attempt to parse a repo is the tests. would you be opposed to me looking at throwing some testing up around this because it's something I enjoy (I'll make another ticket)

pretty-weed avatar Jun 02 '26 23:06 pretty-weed

  1. Yes
  2. Yes, of course

limafresh avatar Jun 03 '26 06:06 limafresh

Okay, another question (sorry just kinda starting to poke at this as I have time on break)

in paint_tools.py PaintTools.brush(), is there a reason that you have all of those functions defined inside of the method? I have preferences against that in cases where it's not particularly useful (reasons: shorter functions are more readable, and performance: don't have to allocate new functions every PaintTools.brush() call if you use a reusable function.

for prev_x, prev_y, and point_history, my gut feeling is that they'd work just as well as arguments and returns, or as instance properties.

not an urgent refactor or anything, but hsppy to produce a refactor PR to show what I mean. Relatively minor changes, as long as I haven't missed anything <3

Sorry, I'm kinda an old Python head, and I can get opinionated (let me know if I should zip it <3)

pretty-weed avatar Jun 08 '26 01:06 pretty-weed

semi related to last comment: how would you feel about me wrapping this up in a proper python package, so it can be installed in a virtualenv?

pretty-weed avatar Jun 08 '26 02:06 pretty-weed

You can create a package for installation in venv if the application can be run the same way as before (python Brushshe/main.py). Regarding paint_tools.py, do you mean nested functions? I used nested functions because they have no meaning outside the function they're nested in.

limafresh avatar Jun 08 '26 09:06 limafresh

you're paying a performance cost every time you have to recreate those functions, and it really hampers readability. TBH it makes the readability bad enough that I'm inclined to find something else to work on after spending some time poking through the repo

pretty-weed avatar Jun 08 '26 18:06 pretty-weed

I understand, so I support getting rid of nested functions. I've already done some refactoring—before that, the files were large and difficult to maintain. I tried to create a simple and understandable structure.

пн, 8 июн. 2026 г., 9:29 PM Dandelion Good @.***>:

pretty-weed left a comment (limafresh/Brushshe#68) https://github.com/limafresh/Brushshe/issues/68#issuecomment-4652154048

you're paying a performance cost every time you have to recreate those functions, and it really hampers readability. TBH it makes the readability bad enough that I'm inclined to find something else to work on after spending some time poking through the repo

— Reply to this email directly, view it on GitHub https://github.com/limafresh/Brushshe/issues/68?email_source=notifications&email_token=BJODFIHNNB63PEJ4XDQSRNT464AZBA5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTINRVGIYTKNBQGQ4KM4TFMFZW63VGMF2XI2DPOKSWK5TFNZ2KYZTPN52GK4S7MNWGSY3L#issuecomment-4652154048, or unsubscribe https://github.com/notifications/unsubscribe-auth/BJODFIHJN6DSSCTXOJJSRE3464AZBAVCNFSM6AAAAACXFEQWFWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHM2DMNJSGE2TIMBUHA . Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS https://github.com/notifications/mobile/ios/BJODFIC3CQT6ON23QCNVVEL464AZBA5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTINRVGIYTKNBQGQ4KM4TFMFZW63VGMF2XI2DPOKSWK5TFNZ2KUZTPN52GK4S7NFXXG and Android https://github.com/notifications/mobile/android/BJODFIBABSTERPJF5VCCLGD464AZBA5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTINRVGIYTKNBQGQ4KM4TFMFZW63VGMF2XI2DPOKSWK5TFNZ2K4ZTPN52GK4S7MFXGI4TPNFSA. Download it today! You are receiving this because you authored the thread.Message ID: @.***>

limafresh avatar Jun 08 '26 18:06 limafresh

Cool thank you so much for understanding, I don't want to be a pain or tell you how to do your thing, just didn't like reading it myself.

I'll get you a refactor PR today

pretty-weed avatar Jun 08 '26 18:06 pretty-weed

You can create a package for installation in venv if the application can be run the same way as before (python Brushshe/main.py). Regarding paint_tools.py, do you mean nested functions? I used nested functions because they have no meaning outside the function they're nested in.

How do you feel about pushing folks to python -m Brushshe.main ? the module invocation would allow for relative imports in main.py, but I don't want to step on any toes

pretty-weed avatar Jun 08 '26 19:06 pretty-weed

That's also a good option if it makes the code better.

limafresh avatar Jun 09 '26 07:06 limafresh

I appreciate you. thank you for taking the time to hold my hand <3 I can give feedback on issues, I'd love to give feedback on repository owners and how responsive and kind they are ⭐ ⭐ 🌟 ⭐ ⭐

pretty-weed avatar Jun 09 '26 22:06 pretty-weed

Thanks!

limafresh avatar Jun 10 '26 06:06 limafresh

@pretty-weed Hello, sorry, but I had to revert to the old structure. There are serious reasons for this that I didn't consider at the time:

  1. Difficulties with packaging in PyInstaller (perhaps the most important one)
  2. Increased code complexity without significant advantages: now you need to test not only running the source code through Python and packaged OS builds, but also the Python package.

I took the rest of your suggestions into account: I left your corrections for messagebox and my removal of nested functions.

limafresh avatar Jun 21 '26 17:06 limafresh