Skip to content

feat: add colors plugin #3

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

a3chron
Copy link
Contributor

@a3chron a3chron commented Aug 4, 2025

View colors in hex, rgb and hsl format, copy convertion to other formats

Edit: should I maybe rather add this in backslash and not as a plugin, so just like in this PR for math?

@a3chron a3chron marked this pull request as draft August 4, 2025 19:54
@a3chron
Copy link
Contributor Author

a3chron commented Aug 4, 2025

Actually, I'll move this to backslash, just like in the mentioned PR for math

Still keeping it as a draft here too, as I am not sure, whether this would support copying the converted values otherwise, so maybe a plugin color converter, and general color display, although I would favor being able to copy a converted color code right at the main command page

@stevenpersia
Copy link
Contributor

Hey! That’s a great plugin idea, and it definitely makes sense to keep it as a plugin. I really want to avoid adding default plugins into Backslash and stick to only apps and shortcuts at the core. So yeah, keep your PR here!

@a3chron
Copy link
Contributor Author

a3chron commented Aug 6, 2025

@stevenpersia Haha just came to close this PR, onyl to noticed your comment lol.

I mean I got a PR for colors too now (backslash-app/backslash#45), so you can check both out and decide what fits better.

I definitely agree that it should not be overfilled with default plugins, although I think some should be okay, if they have strict handling over when they will be shown.
For example the default color plugin / color command would be only shown if a user typed in # followed by either 3 or 6 valid hex characters, or rgb( followed by valid color values, and a closing bracket, and similar for hsl formats, so I think in that case that would just show up if a user really did past a color / is typing a color and finished that.

So I would probably actually favor the color command as a "default plugin", as it would save users a few click / selects etc.
With the plugin, you currently would have to specify what kind of color format you want to, for example hex, then select that command, and only then paste you color, not much of an overhead, and could be simplified to onyl one command and auto color detection, but still, it's not that fast...

On the other side, with the plugin there is theoretically the option to copy the converted color formats via keyboard (ctrl+g, select what format, and enter I presume, didn't use it, maybe it still has to be a click.)
For the color command, one would have to copy it manually for now, i.e. select the displayed text for other color formats, although I'd add some kind of keyboard shortcut to that too with time.

So as I said, check out the PR, and decide what you think fits better, you can close the other one :)

@a3chron a3chron marked this pull request as ready for review August 6, 2025 09:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants