For example, when using the “Dark vador” theme in document X, how would you modify the color of headings in document X only?
How do you tweak the colors in a theme for a particular document?
I have investigated a bit, starting from packages/themes/vador/vador-scene.ts
I have figured out (or maybe figure out again: it is possible that i knew and I forgot) that the title block is a table, so you need to modify the background of the cell which contains the title.
You can do it by adding a cwith
condition with cell-background
(sorry that the formatting is cramped, I am not able to format the code in a different way and retain the possibilty of pasting it in the preamble of a TeXmacs document with the command Paste from -> TeXmacs)
<assign|vador-title-bg-color|light blue>
<assign|doc-title-block|<macro|body|<tabular*|<tformat|<twith|table-width|1par>|<cwith|1|1|1|1|cell-lsep|0spc>|<cwith|1|1|1|1|cell-rsep|0spc>|<cwith|1|1|1|1|cell-bsep|0spc>|<cwith|1|1|1|1|cell-tsep|0spc>|<cwith|1|1|1|1|cell-hyphen|t>|<cwith|1|1|1|1|cell-background|<value|vador-title-bg-color>>|<table|<row|<\cell>
<\with|par-mode|center>
<arg|body>
</with>
</cell>>>>>>>
For other elements I would have to investigate one by one, sorry but I do not have an overview of page formatting
Edit: after a bit more investigation, here is how to change the color of section headings:
<assign|prefixed-line|<\macro|prefix|body>
<\with|par-first|0fn>
<\description-table>
<tformat|<twith|table-valign|T>|<twith|table-hmode|min>|<cwith|1|-1|1|-1|cell-lsep|0em>|<cwith|1|-1|1|-1|cell-rsep|0em>|<cwith|1|1|1|-1|cell-tsep|0em>|<cwith|-1|-1|1|-1|cell-bsep|0em>|<cwith|1|-1|1|-1|cell-vcorrect|n>|<table|<row|<cell|<with|color|red|<arg|prefix>>>|<\cell>
<with|color|red|<arg|body>>
</cell>>>>
</description-table>
</with>
</macro>>
Changing background using again the cwith
condition here is not as flexible as I would like, I am not able to alter the background of the whole line.
Maybe the GUI should allow you to override the color from a theme from within a document and also to change it back to the default?
I believe this is possible to program by a user—did not try it myself. It could be a nice project
I think this should be a general feature in the GUI: the ability to override many sorts of properties (not just colors) in a style/theme from within a document and also to change them back to their defaults for that style/theme.
I think it is a valid effort trying to program it in. If you have the time and enough Scheme experience it could even be something worth your attention (as a first step, you could publish it on tm-forge).
I did not think about this enough to have a clear idea of how it works, maybe one would have also to systematize the way themes modify typographical elements.