For example, given the following codes:
#let a = text(blue)[a is blue]
#let b = text()[b is green]
#set text(green)
#a
#b
Can I get the colors of a or b? I want to use them to set other colors.
For example, given the following codes:
#let a = text(blue)[a is blue]
#let b = text()[b is green]
#set text(green)
#a
#b
Can I get the colors of a or b? I want to use them to set other colors.
I don’t think there is a good way to look into a
and see which styles it’s using or which color. And the content in variable b
does not have any particular text color by itself - it will follow the style context wherever b
is later used or expanded.
You can read the current color using text.fill
. So after set text(green)
, you can read it like this #context text.fill
and see that the current color is that green. But that’s rarely needed…
Would it help to try to give name to the different styles, for example using labels?
#show <style1>: set text(blue)
#show <style2>: set text(green)
#[This is style1]<style1>
#[This is style2]<style2>
#context {text.fill}<style1>
#context {text.fill}<style2>