garglk_set_zcolors is documented here: https://curiousdannii.github.io/if/gargoyle.html
One question that isn’t discussed there is what glk_style_measure() should return when you’re setting colors using garglk_set_zcolors().
I believe Spatterlight and Gargoyle currently disagree about how to implement glk_style_measure for TextColor and BackColor.
- Spatterlight incorporates the
currentZColorandcurrentReverseVideo. It’s reporting on what color the next character would be if it were printed. - Gargoyle just consults its stylehint model.
I’m inclined to say that Spatterlight’s way is best, because I see no other way to detect whether garglk_set_zcolors had an effect. For example, it might not have had an effect if the user has disabled author-defined colors with the stylehint 0 setting in garglk.ini. (Despite the name, stylehint also applies to zcolors.)
But maybe Gargoyle’s way is best. garglk_set_zcolors sets the color of spans of text; I’d expect that it’d ordinarily be used for overriding the normal text color. If you want to know what the “normal text color” currently is, Spatterlight has no way of telling you that.
Maybe there ought to be some (new?!) specific function to detect whether garglk_set_zcolors actually worked…?