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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is it possible to limit the color range? #3

Open
scarlion1 opened this issue Nov 16, 2022 · 2 comments
Open

Is it possible to limit the color range? #3

scarlion1 opened this issue Nov 16, 2022 · 2 comments

Comments

@scarlion1
Copy link

I really like this prompt so much that I've put it on more shells than I should have 馃槄 Since the prompts look so similar, sometimes I forget which computer I'm using, even though it's right in the prompt, and in the terminal window's title 馃槢 Instead, I thought it might be nice if I could make one shell bluish, another orangish, etc... Is there perhaps a way to limit the range of colors it will use? e.g. just use colors in the green-yellow-orange range and leave out the rest, the reds, purples, blues basically? Perhaps I could make some minor changes to https://github.com/dosentmatter/lolcat/blob/master/lolcat.c?
Thanks

@dosentmatter
Copy link
Owner

Thanks for using the prompt!

It doesn't look like lolcat.c supports limiting colors. My lolcat.c is pretty behind the upstream repo. You would have to submit changes to my fork or fork https://github.com/jaseg/lolcat on your own.

lolcat.c has a list of ANSI color codes that it randomly indexes:
https://github.com/dosentmatter/lolcat/blob/master/lolcat.c#L52

You can see the colors here:
https://www.lihaoyi.com/post/BuildyourownCommandLinewithANSIescapecodes.html#256-colors

You can modify the code to accept options for different sets of colors with corresponding array of ANSI color codes to index from.

@scarlion1
Copy link
Author

Cool thanks. Yes I see... well for now I just used the numbers from Haoyi's color table and put the one's I wanted to use in your lolcat.c's codes[] array.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants