Skip to content

feat: add ansi colours#66

Draft
backwardspy wants to merge 4 commits into
mainfrom
feat/ansi
Draft

feat: add ansi colours#66
backwardspy wants to merge 4 commits into
mainfrom
feat/ansi

Conversation

@backwardspy

@backwardspy backwardspy commented Dec 7, 2024

Copy link
Copy Markdown
Member

demo of what works currently:

---
whiskers:
  version: '^2.5'
  hex_format: "#{{R}}{{G}}{{B}}"
---
ansi colours:
{% for _, c in flavor.ansi_colors -%}
{{ c.name }} ({{ c.code }}) {{ c.hex }}
{% endfor %}
ansi colour pairs:
{% for _, pair in flavor.ansi_color_pairs -%}
{{ pair.name }} ({{ pair.normal.code }}) {{ pair.normal.name }} | ({{ pair.bright.code }}) {{ pair.bright.name }}
{% endfor -%}
ansi colours:
Black (0) #5C5F77
Red (1) #D20F39
Green (2) #40A02B
Yellow (3) #DF8E1D
Blue (4) #1E66F5
Magenta (5) #EA76CB
Cyan (6) #179299
White (7) #ACB0BE
Bright Black (8) #6C6F85
Bright Red (9) #DE293E
Bright Green (10) #49AF3D
Bright Yellow (11) #EEA02D
Bright Blue (12) #456EFF
Bright Magenta (13) #FE85D8
Bright Cyan (14) #2D9FA8
Bright White (15) #BCC0CC

ansi colour pairs:
Black (0) Black | (8) Bright Black
Red (1) Red | (9) Bright Red
Green (2) Green | (10) Bright Green
Yellow (3) Yellow | (11) Bright Yellow
Blue (4) Blue | (12) Bright Blue
Magenta (5) Magenta | (13) Bright Magenta
Cyan (6) Cyan | (14) Bright Cyan
White (7) White | (15) Bright White

todo:

  • ansi pairs
  • overrides
  • docs
  • test on actual terminal ports
    • then publish stable ctp/rust crate

@ninetailedtori

ninetailedtori commented Feb 1, 2026

Copy link
Copy Markdown

Hiya, had a few questions wrt this one!

  • Will these be inherited from the color class
    • say if we want to grab the RGB value, or uint32, or HSL?
    • Edit: this will use AnsiColor class, which then is nested in AnsiColorPair, which is primarily a wrapper to add normal and bright tags to colour identifiers.
  • I assume this'll include the whole if(cond=flavor.dark, t=<dark-color>, f=<light-color>) thing too, right? :3
    • Edit: this already contains identification of black and white colours!

@latin-1

latin-1 commented Feb 2, 2026

Copy link
Copy Markdown

I don't mean to rush you, but it has been a year, which feels like quite a long time. Are there any major blockers preventing us from merging this MR?

@ninetailedtori

Copy link
Copy Markdown

I don't mean to rush you, but it has been a year, which feels like quite a long time. Are there any major blockers preventing us from merging this MR?

In terms of what I've heard, we're looking for documentation, and further testing, on this PR? cc: @backwardspy would have to confirm that though.

@ninetailedtori

Copy link
Copy Markdown

#119 opened to hopefully finish up docs, merge main into with collisions calculated, and fix order to u8 if my rust pr goes through hopefully :]

ninetailedtori added a commit to ninetailedtori/tty that referenced this pull request Feb 3, 2026
Signed-off-by: Toria <ninetailedtori@uwu.gal>
ninetailedtori added a commit to ninetailedtori/wezterm that referenced this pull request Apr 7, 2026
Blocked by: catppuccin/whiskers#66.

Signed-off-by: Toria <ninetailedtori@uwu.gal>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants