-
Notifications
You must be signed in to change notification settings - Fork 62
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
Added support for basic colors #7
Conversation
Added support for base colors. e.g. hr . red hr +- yellow hr cyan
How to use colors
Hi! Thank you very much for the pull request! This is a very good idea, I wonder if we could not have the hard-coded colours in the script thought, it doesn't look good... Another thing that I dislike is that if you misspell a colour, you get the character in the separator. Cheers |
How about this ... It also allows to enter a number from 0 to 256 for custom colors I also kept the hardcoded shortcuts because not everyone knows color codes. If you enter an out of range number or a mispelled color name, it doesn't affect the output. |
How about using some other command through which you can pipe the output from 'hr'? Not sure if this doesn't already exist. You could name it 'hl' to keep it simple (highlight). Then you could write something like: Of course, you can add extra features to it, like support for HTML color codes, foreground / background colors, blinking (if you really want to annoy your users), etc. And you could also combine it to have one row in one color, followed by another in a different color: hr '=' | hl white && hr '#' | hl gray Edit: Sorry if I 'hijacked' the thread, didn't mean to. |
Hi @cbanu, Thank you for your input, actually I was thinking about something like that, since then hr would not need to care about colours. I have an idea in mind...hold on. Cheers |
Hi guys, This discussion gave me the idea of creating a @donebizkit I used a lot of your code in the new project, if you want, I can add an empty commit on your behalf just so you can appear in the contributors section of the project, if you want me to. So I will close this issue since colouring was added very very indirectly to I added you two to the acknowledgements section of the README of the repo of course :). Here is the Cheers |
The acknowledgement is enough. I'll keep an eye of both projects in case I have something to add. |
You can use basic colors as follows:
hr . red
hr ++ yellow
hr blue