reobin / typewritten

A minimal, lightweight, informative zsh prompt theme

Home Page:https://typewritten.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

24 bit colors

jerbaroo opened this issue · comments

commented

Is your feature request related to a problem? Please describe.
I use a color theme for emacs and tmux, this theme is Dracula. I would like to set typewritten colors that match this theme.

Describe the solution you'd like
This would be possible if I could set any 24 bit color code instead of only one of the ANSI colors.

Additional context
The image below shows the colors I use with tmux, I would like the typewritten prompt and current directory to also use colors directly from the Dracula theme, to match the rest of the colors.

Screenshot 2020-08-04 at 16 36 42

Hi @barischrooneyj !

Turns out this is definitely possible if your terminal supports true color.
It would technically be possible right now if the regex validating the TYPEWRITTEN_COLORS variable wasn't so restrictive.
I'll update this today so that you can create your theme.

Hex color codes will be supported like this:

export TYPEWRITTEN_COLORS="prompt:#008080;symbol:#682d1e;git_branch:#30bf2d;current_directory:#8ac988"

I'm quite happy with how this one turned out, and gives me the idea of creating themes for the prompt! A theme could simply be a preset of color settings. Dracula could be the first one 🚀

I'm not normally that fast, but this was a quick fix.

npm update -g typewritten (or whatever you had it installed with) 😊

@barischrooneyj I just pushed a new version which will make it easier to create themes.

When you're up to date, add this variable to your .zshrc and you should have a nice dracula theme going on.

export TYPEWRITTEN_COLOR_MAPPINGS="primary:#9580FF;secondary:#8AFF80;accent:#FFFF80;info_negative:#FF80BF;info_positive:#8AFF80;info_neutral_1:#FF9580;info_neutral_2:#FFFF80;info_special:#80FFEA"
commented

@reobin this looks great! thank you very much!

Perhaps adding some information to the wiki about where the different color components (e.g. info_negative:#FF80BF) are used, would be useful.

Thanks again!

I actually just did that!

Not sure about the readability since there is now quite a lot of info on that page. Might separate into sub-pages later.

@all-contributors please add @barischrooneyj for ideas

@reobin

I've put up a pull request to add @barischrooneyj! 🎉