Make Terminal Theme Colour array a typed listed instead #993

Open
opened 2026-01-30 22:13:19 +00:00 by claunia · 0 comments
Owner

Originally created by @ObsidianPhoenix on GitHub (May 12, 2019).

I've opted to submit this as an issue here as I may be able to effect the change myself, but I wanted to submit it for discussion before doing work/issuing a PR (and I'd probably need a little help finding the relevant place in code).

The current Terminal Theme json requires a color array of 16 RGB values:

{
  "name": "Test",
  "foreground": "#FFFFFF",
  "background": "#000000",
  "colors": [
    "#FFFFFF",
    "#808080",
    "#FFFFFF",
    "#808080",
    "#000000",
    "#000000",
    "#FFA500",
    "#000000",
    "#808080",
    "#FF0000",
    "#0000FF",
    "#FFFF00",
    "#0000FF",
    "#0000FF",
    "#0000FF",
    "#1F1F1F"
  ]
}

These values look like the align with the Vim Terminal Colours. However, its not immediately obvious what the usage of these array elements actually are (not how their index is important).

Since brevity is not really a concern in this case (we're not attempting to transmit this over the wire, etc), I feel like this is simply acting as a barrier to entry for theme designers.

I'd like to suggest replacing this array with a typed collection of properties, e.g.

{
  "name": "Test",
  "foreground": "#FFFFFF",
  "background": "#000000",
  "Black": "#FFFFFF",
  "Red": "#808080",
  "Green": "#FFFFFF",
  "Yellow": "#808080",
  "Blue": "#000000",
  "Purple": "#000000",
  "Cyan": "#FFA500",
  "White": "#000000",
  "BrightBlack": "#808080",
  "BrightRed": "#FF0000",
  "BrightGreen": "#0000FF",
  "BrightYellow": "#FFFF00",
  "BrightBlue": "#0000FF",
  "BrightPurple": "#0000FF",
  "BrightCyan": "#0000FF",
  "BrightWhite": "#1F1F1F"
}

Or a similar structure, e.g.

{
  "name": "Test",
  "foreground": "#FFFFFF",
  "background": "#000000",
  "NormalColors": {
    "Black": "#FFFFFF"
    // ...
  },
  "BrightColors": {
    "Black": "#808080",
    // ...
  }```

Alternative names for the colour items (which might make it more obvious what their intention is are also an option (e.g. ConsoleBlack).

Changing this now will reduce the barrier to entry for theme writers, before a point where too many themes exist to cause a breaking change.

Originally created by @ObsidianPhoenix on GitHub (May 12, 2019). I've opted to submit this as an issue here as I may be able to effect the change myself, but I wanted to submit it for discussion before doing work/issuing a PR (and I'd probably need a little help finding the relevant place in code). The current Terminal Theme json requires a `color` array of 16 RGB values: { "name": "Test", "foreground": "#FFFFFF", "background": "#000000", "colors": [ "#FFFFFF", "#808080", "#FFFFFF", "#808080", "#000000", "#000000", "#FFA500", "#000000", "#808080", "#FF0000", "#0000FF", "#FFFF00", "#0000FF", "#0000FF", "#0000FF", "#1F1F1F" ] } These values look like the align with the [Vim Terminal Colours](https://jeffkreeftmeijer.com/vim-16-color/). However, its not immediately obvious what the usage of these array elements actually are (not how their index is important). Since brevity is not really a concern in this case (we're not attempting to transmit this over the wire, etc), I feel like this is simply acting as a barrier to entry for theme designers. I'd like to suggest replacing this array with a typed collection of properties, e.g. { "name": "Test", "foreground": "#FFFFFF", "background": "#000000", "Black": "#FFFFFF", "Red": "#808080", "Green": "#FFFFFF", "Yellow": "#808080", "Blue": "#000000", "Purple": "#000000", "Cyan": "#FFA500", "White": "#000000", "BrightBlack": "#808080", "BrightRed": "#FF0000", "BrightGreen": "#0000FF", "BrightYellow": "#FFFF00", "BrightBlue": "#0000FF", "BrightPurple": "#0000FF", "BrightCyan": "#0000FF", "BrightWhite": "#1F1F1F" } Or a similar structure, e.g. { "name": "Test", "foreground": "#FFFFFF", "background": "#000000", "NormalColors": { "Black": "#FFFFFF" // ... }, "BrightColors": { "Black": "#808080", // ... }``` Alternative names for the colour items (which might make it more obvious what their intention is are also an option (e.g. `ConsoleBlack`). Changing this now will reduce the barrier to entry for theme writers, before a point where too many themes exist to cause a breaking change.
claunia added the Issue-FeatureHelp WantedArea-Settings labels 2026-01-30 22:13:19 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#993