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: add custom hex formatting #18

Merged
merged 1 commit into from
Jun 14, 2024
Merged

feat: add custom hex formatting #18

merged 1 commit into from
Jun 14, 2024

Conversation

backwardspy
Copy link
Member

adds a new hex_format string option to the template frontmatter. this string, if set, is used to render all hex-format colours in the template with tera.

the previous (undocumented) hex_prefix and capitalize_hex options are now deprecated, but do still work.

based on work done in catppuccin/toolbox#172

adds a new `hex_format` string option to the template frontmatter.

this string, if set, is used to render all hex-format colours in the
template with tera.

the following context variables are available:

- r: red
- g: green
- b: blue
- a: alpha
- z: alpha, or blank if alpha == 0xFF

these are all lowercase 2-digit hex values, for example '7e'.

all five of these have uppercase counterparts, for example `G`, which
are uppercase 2-digit hex values, for example '7E'.

the default format is `{{r}}{{g}}{{b}}{{z}}`.

Co-authored-by: Ruby <[email protected]>
@backwardspy backwardspy merged commit dfc700e into main Jun 14, 2024
6 checks passed
@backwardspy backwardspy deleted the feature/hexformat branch June 14, 2024 15:09
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.

2 participants