We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Coloring text does not work. Consider the following code:
import matplotlib as mpl import matplotlib.pyplot as plt import mpl_typst.as_default # noqa: F401 fig, ax = plt.subplots(1, 1) colors = ["C0", "C1", "C2"] linestyles = ["-", ":", "-."] legend = ax.legend( [ mpl.lines.Line2D([], [], ls=ls, color=color) for ls, color in zip(linestyles, colors, strict=True) ], ["text0", "text1", "text2"], loc="center", ncol=3, borderaxespad=0.5, ) for text, color in zip(legend.get_texts(), colors, strict=True): text.set_color(color) fig.savefig("test.typ")
The result should be: In the created typst file, however, the text is black and not colored.
The text was updated successfully, but these errors were encountered:
I think somewhere in the draw_text function, we must call gc.get_rgb() to get the color and adjust draw-text to take a fill argument so that we can do
draw_text
gc.get_rgb()
draw-text
fill
text(..., fill: color, content)
in prologue.typ.
prologue.typ
Sorry, something went wrong.
No branches or pull requests
Coloring text does not work. Consider the following code:
The result should be:
In the created typst file, however, the text is black and not colored.
The text was updated successfully, but these errors were encountered: