【问题标题】:Pyx have a curve and its curve text have different colorsPyx有一条曲线,它的曲线文字有不同的颜色
【发布时间】:2020-07-23 01:32:35
【问题描述】:

愚蠢的问题,但是,我有以下 pyx 图:

我希望边缘中的文本为黑色,但边缘本身保持红色。

这是我的代码:

   c.stroke(path.line(p1[0], p1[1], p2[0], p2[1]),
        [
            style.linecap.round, color.rgb(tcolor[0], tcolor[1], tcolor[2]),
            deco.curvedtext(f"\huge{{{label}}}", textattrs=[text.halign.center],
            exclude=0.1)
        ])

【问题讨论】:

    标签: python latex drawing pyx


    【解决方案1】:

    刚刚想通了:

    c.stroke(path.line(p1[0], p1[1], p2[0], p2[1]),
        [
            style.linecap.round, color.rgb(tcolor[0], tcolor[1], tcolor[2]),
            deco.curvedtext(f"\huge{{{label}}}", textattrs=[text.halign.center, color.rgb.black],
            exclude=0.1)
        ])
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2022-10-01
      • 1970-01-01
      • 1970-01-01
      • 2017-06-09
      • 2019-01-26
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多