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

feat: Default theme palette using 16 terminal colors #699

Merged
merged 2 commits into from
Sep 5, 2021

Conversation

sudormrfbin
Copy link
Member

@sudormrfbin sudormrfbin commented Sep 2, 2021

Closes #687

Allows using default terminal colors in the theme like so:

ui.background = "white"
ui.text = "magenta"

This requires that there is no separate [palette] section in the theme file. If it is present, that palette will completely override the default palette (there is no merging).

The default palette is merged with the user palette, with the user palette taking precedence.

Copy link
Contributor

@pickfire pickfire left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

@sudormrfbin sudormrfbin force-pushed the default-terminal-colors branch from c9ac2fb to 2cbaed5 Compare September 3, 2021 15:14
palette: mut default,
} = ThemePalette::default();

default.extend(palette);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't all of this the same as

let theme = ThemePalette::default();
theme.palette(palette);
theme

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But there is no palette method on ThemePalette ? Also we are merging the user palette onto the default palette so that the defaults can be overridden.

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.

Can I use default terminal colors?
3 participants