How does asciinema capture and reinterpret colors?

Hi Asciinema —

First, thanks for this terrific piece of technology—I love it!

I’m trying to better understand how the colors displayed in my terminal during recording relate to those that are used during playback. From my limited experience so far, I’m finding that some colors that I’ve set (e.g., those used to highlight strings or comments in emacs) tend to be preserved during playback, while others (e.g., the one set in PS1 for entering commands, or for keywords in emacs) are not. I understand that the themes used by asciinema need to be able to influence which colors are used during playback, but am having trouble understanding why some choices I make seem to stick, but not others. Or maybe more to the point: I’m having trouble with color decisions I’ve made in my local environment looking good in the asciinema themes (and am not certain I want to go so far as to invent a new asciinema theme myself).

Related: I tend to use a terminal with a white background, but have been unable to find a theme that preserves that. I thought when I was cycling through the five themes the other day, I did find one, but today they all seem to have dark backgrounds other than solarized-light (?).

Thanks for any help here,
-Brad

I am not affiliated with the platform but i would say than ansi escapes captured from terminal are likely being processed via javascript wizardry into a 256 color palette that your browser is likely to interpret correctly (and accross most if not all of other graphical browsers there is out there)

As far as theme, i really never asked myself the question, probably just figured it would base itself on whatever science there is originally, within a shell’s TERM existing color schemes and themes. Other than that, i guess i also always assumed that only color tints and emphasis (bold/light/tones) and background colors would/were change/d

I am waiting for a reply too, then (for lack of time to investigate on my own)

Im not sure white bg is an actual terminal background color as much as it is a customization option that the specific terminal you use allows you to set, only locally (to you), at runtime with whatever gtk tricks that could apply, while keeping the actual terminal bg color a typical (and well understood) black color.

Again, this is only what goes in my head as i read your post. Interresting questions that will make me learn the basis of older rerminals and their capabilities beyond what i already (rather think) i already know.

Thanks for the question, Hopefuly @ku1ik can shed a light on that or give us pointers with wich we can extrapolate a better answer than only my thoughts! Let us know if you come accross anything in the meantime.

1 Like