Skip to content
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

Custom color selectors support #111

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

Custom color selectors support #111

wants to merge 3 commits into from

Conversation

Tolyar
Copy link

@Tolyar Tolyar commented Aug 11, 2020

I've starting create color themes for kubectl commands. The first one is kubectl get pods. But I can't create some logic without custom color selectors (like Scale or Rainbow). For example I need two digits comparer that will choose color by percentage ranges. I've created BaseSelector and PercentSelector as child of BaseSelector. BaseSelector should be a parent for any custom selectors. I've push this selectors into context and now it is possible to create any custom selectors inside colout_.py files. Example of usage for custom selectors is kubectlpods theme.
For example kubectl get pods |colout.py -t kubectlpods

Custom color selector is a Class with extended logic.
For example compare two numbers and select color by percents using.
@nojhan
Copy link
Owner

nojhan commented Aug 12, 2020

I'm not sure to understand which problem this (nice code) solves. So far I don't see anything which would not be solved by some regexp magic, like echo "80%" | colout "([0-2][0-9])*([3-5][0-9])*([6-9][0-9])*%" green,yellow,red
Can you explain or —even better— add the rationale and some example to the documentation?

@Tolyar
Copy link
Author

Tolyar commented Aug 13, 2020 via email

@nojhan
Copy link
Owner

nojhan commented Aug 17, 2020

OK, I understand now. I definitely need a doc update before merging, though.

@Tolyar
Copy link
Author

Tolyar commented Aug 24, 2020 via email

@nojhan
Copy link
Owner

nojhan commented Aug 26, 2020

Yes please, the README at least. Ideally the website, but I would understand that the (old) github pages is cumbersome.

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