[GH-ISSUE #221] asciicast v2: stored color theme spec #162

Closed
opened 2026-02-25 20:32:55 +03:00 by kerem · 1 comment
Owner

Originally created by @ku1ik on GitHub (Sep 4, 2017).
Original GitHub issue: https://github.com/asciinema/asciinema/issues/221

We're discussing version 2 of asciicast format in asciinema/asciinema#196, and I think adding optional colors object to the header, containing text foreground/background color and the palette for all 8(16) colors would be a nice addition. It could be saved automatically by asciinema rec and used by web player.

As @mrabault said in asciinema/discussions#8, we can use and update a technique of obtaining the colors, as long as the palette representation in asciicast header stays the same/compatible with the web player. As for the actual technique, let's keep it discussed in asciinema/discussions#8.

Anyway, what we can add to v2 header is the optional key named colors (or theme ?):

{
  "version": 2,
  "width": 80,
  "height": 24,
  "theme": {
    "fg": "#d0d0d0",
    "bg": "#212121",
    "palette": "#151515:#ac4142:#7e8e50:#e5b567:#6c99bb:#9f4e85:#7dd6cf:#d0d0d0:#505050:#ac4142:#7e8e50:#e5b567:#6c99bb:#9f4e85:#7dd6cf:#f5f5f5"
  }
}

I took inspiration to use single string value for all 16 colors from Terminator theme syntax which is compact and it's easy to write/read/parse for both humans and machines.

Originally created by @ku1ik on GitHub (Sep 4, 2017). Original GitHub issue: https://github.com/asciinema/asciinema/issues/221 We're discussing version 2 of asciicast format in asciinema/asciinema#196, and I think adding optional colors object to the header, containing text foreground/background color and the palette for all 8(16) colors would be a nice addition. It could be saved automatically by `asciinema rec` and used by web player. As @mrabault said in asciinema/discussions#8, we can use and update a technique of obtaining the colors, as long as the palette representation in asciicast header stays the same/compatible with the web player. As for the actual technique, let's keep it discussed in asciinema/discussions#8. Anyway, what we can add to v2 header is the optional key named `colors` (or `theme` ?): ```json { "version": 2, "width": 80, "height": 24, "theme": { "fg": "#d0d0d0", "bg": "#212121", "palette": "#151515:#ac4142:#7e8e50:#e5b567:#6c99bb:#9f4e85:#7dd6cf:#d0d0d0:#505050:#ac4142:#7e8e50:#e5b567:#6c99bb:#9f4e85:#7dd6cf:#f5f5f5" } } ``` I took inspiration to use single string value for all 16 colors from [Terminator theme syntax](https://github.com/mbadolato/iTerm2-Color-Schemes/blob/master/terminator/Afterglow.config) which is compact and it's easy to write/read/parse for both humans and machines.
kerem closed this issue 2026-02-25 20:32:55 +03:00
Author
Owner

@ku1ik commented on GitHub (Sep 17, 2017):

This was added to the v2 spec in asciinema/asciinema#233.

<!-- gh-comment-id:330037213 --> @ku1ik commented on GitHub (Sep 17, 2017): This was added to the v2 spec in asciinema/asciinema#233.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/asciinema#162
No description provided.