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

Add color theme config #550

Merged
merged 2 commits into from
May 30, 2021
Merged

Add color theme config #550

merged 2 commits into from
May 30, 2021

Conversation

a-kenji
Copy link
Contributor

@a-kenji a-kenji commented May 29, 2021

  • add option theme that allows for setting of a theme,
    the default is default

  • under themes the themes can be described as follows:

either

themes:
  default:
    fg: [0,0,0]
    bg: [0,0,0]
    black: [0,0,0]
    red: [0,0,0]
    green: [0,0,0]
    yellow: [0,0,0]
    blue: [0,0,0]
    magenta: [0,0,0]
    cyan: [0,0,0]
    white: [0,0,0]
    orange: [0,0,0]

or

themes:
  default:
    fg: 0
    bg: 0
    black: 0
    red: 0
    green: 0
    yellow: 0
    blue: 0
    magenta: 0
    cyan: 0
    white: 0
    orange: 0

If the key is different from default, it needs to either be specified on
start with options --theme [THEME], or in the configuration file under
theme: [THEME].

closes #390

@a-kenji a-kenji requested a review from kunalmohan May 29, 2021 20:21
@a-kenji
Copy link
Contributor Author

a-kenji commented May 29, 2021

This is not quite ready yet, since the theme reverts to its default
once its mode is changed.

I am not sure where we should attach the client attrs in route in order to get the
attributes of the client palette attributes.

I would be happy about any input here.

@a-kenji a-kenji requested a review from imsnif May 29, 2021 20:39
@imsnif
Copy link
Member

imsnif commented May 29, 2021

Just a heads up: some terminals don't support truecolor. That's the reason our default theme uses 256 colors. It might be a good idea to differentiate the themes to 256 and truecolor themes. Or at least provide a configuration option for 256 colored themes.

@a-kenji
Copy link
Contributor Author

a-kenji commented May 29, 2021

Oh yeah, that is also possible to specify currently.
I will update the current post.

@kunalmohan
Copy link
Member

I am not sure where we should attach the client attrs in route in order to get the
attributes of the client palette attributes.

The idea was to have screen and plugins to store a copy of the palette and generate the mode_info themselves when the mode changes (instead of having the router thread do that). Original comment: https://discord.com/channels/771367133715628073/773128553524494367/843837258120298577

But it'll, probably, be a while before this is done (Brooks is currently working on the resizing algorithm), so maybe go with plan B and store the palette in SessionMetaData for now and use that palette here instead of the default one?

What do you think @imsnif ?

@a-kenji
Copy link
Contributor Author

a-kenji commented May 30, 2021

I think that is a good idea for now then.
Thank you for showing me the discussion @kunalmohan!

* add option `theme` that allows for setting of a theme,
the default is `default`

* under `themes` the themes can be described as follows:

either:
```
themes:
  default:
    fg: [0,0,0]
    bg: [0,0,0]
    black: [0,0,0]
    red: [0,0,0]
    green: [0,0,0]
    yellow: [0,0,0]
    blue: [0,0,0]
    magenta: [0,0,0]
    cyan: [0,0,0]
    white: [0,0,0]
    orange: [0,0,0]
```
or
```
themes:
  default:
    fg: 0
    bg: 0
    black: 0
    red: 0
    green: 0
    yellow: 0
    blue: 0
    magenta: 0
    cyan: 0
    white: 0
    orange: 0
```

If the key is different from default, it needs to either be specified on
start with `options --theme [THEME]`, or in the configuration file under
theme: [THEME].

closes zellij-org#390
@a-kenji a-kenji merged commit bbbc51d into zellij-org:main May 30, 2021
@a-kenji a-kenji deleted the theme-config branch May 30, 2021 17:38
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.

Color scheme support
3 participants