-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Improved color framework #99
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Awesome! That file's been in need of some love. I've verified that this works on iTerm2 in Lion. |
gaelicWizard
added a commit
to gaelicWizard/bash-it
that referenced
this pull request
Jan 5, 2022
This reverts Bash-it#99, a metaprogramming adventure in terminal color code escape computation. It was functionally reverted in Bash-it#699; I'm just finishing the job.
6 tasks
gaelicWizard
added a commit
to gaelicWizard/bash-it
that referenced
this pull request
Jan 5, 2022
This reverts Bash-it#99, a metaprogramming adventure in terminal color code escape computation. It was functionally reverted in Bash-it#699; I'm just finishing the job.
gaelicWizard
added a commit
to gaelicWizard/bash-it
that referenced
this pull request
Jan 8, 2022
This reverts Bash-it#99, a metaprogramming adventure in terminal color code escape computation. It was functionally reverted in Bash-it#699; I'm just finishing the job.
gaelicWizard
added a commit
to gaelicWizard/bash-it
that referenced
this pull request
Jan 9, 2022
This reverts Bash-it#99, a metaprogramming adventure in terminal color code escape computation. It was functionally reverted in Bash-it#699; I'm just finishing the job.
gaelicWizard
added a commit
to gaelicWizard/bash-it
that referenced
this pull request
Jan 9, 2022
This reverts Bash-it#99, a metaprogramming adventure in terminal color code escape computation. It was functionally reverted in Bash-it#699; I'm just finishing the job.
gaelicWizard
added a commit
to gaelicWizard/bash-it
that referenced
this pull request
Jan 9, 2022
This reverts Bash-it#99, a metaprogramming adventure in terminal color code escape computation. It was functionally reverted in Bash-it#699; I'm just finishing the job.
gaelicWizard
added a commit
to gaelicWizard/bash-it
that referenced
this pull request
Jan 9, 2022
This reverts Bash-it#99, a metaprogramming adventure in terminal color code escape computation. It was functionally reverted in Bash-it#699; I'm just finishing the job.
gaelicWizard
added a commit
to gaelicWizard/bash-it
that referenced
this pull request
Jan 9, 2022
This reverts Bash-it#99, a metaprogramming adventure in terminal color code escape computation. It was functionally reverted in Bash-it#699; I'm just finishing the job.
gaelicWizard
added a commit
to gaelicWizard/bash-it
that referenced
this pull request
Jan 25, 2022
This reverts Bash-it#99, a metaprogramming adventure in terminal color code escape computation. It was functionally reverted in Bash-it#699; I'm just finishing the job.
gaelicWizard
added a commit
to gaelicWizard/bash-it
that referenced
this pull request
Jan 25, 2022
This reverts Bash-it#99, a metaprogramming adventure in terminal color code escape computation. It was functionally reverted in Bash-it#699; I'm just finishing the job.
gaelicWizard
added a commit
to gaelicWizard/bash-it
that referenced
this pull request
Jan 26, 2022
This reverts Bash-it#99, a metaprogramming adventure in terminal color code escape computation. It was functionally reverted in Bash-it#699; I'm just finishing the job.
gaelicWizard
added a commit
to gaelicWizard/bash-it
that referenced
this pull request
Jan 28, 2022
This reverts Bash-it#99, a metaprogramming adventure in terminal color code escape computation. It was functionally reverted in Bash-it#699; I'm just finishing the job.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi,
I wrote some code to make the colors more poweful. The old color variables have been converted using the new function and should contain more or less the same content as before.
There's now some color and echo_color functions that can be called and that will produce ANSI escape codes, by parsing the parameters of the functions.$(color red fg bright black bg underline bold) creates some bright red foreground, black background with bold and underline ANSI codes that will be used until $ (color reset) (or ${normal}) is found.
Functions parameters are parsed until exhausted so they can be put together. For example:
It should also be compatible with xterm 256 colors (at least that works on Gnome Terminal, not tested anywhere else).
For example $(color rgb 127 0 0) will (try to) produce half pure red.
I haven't tested anywhere except on my Debian Gnome Terminal, I don't guarantee everything works fine... but feel free to take the code if you want.