找回密码
 快速注册
搜索
查看: 58|回复: 5

Asymptote里怎么用xcolor里的颜色?

[复制链接]

413

主题

1558

回帖

1万

积分

积分
11498

显示全部楼层

abababa 发表于 2023-6-30 20:45 |阅读模式
如题,代码如下:
  1. \begin{asy}
  2. unitsize(2cm);
  3. currentprojection=orthographic(0.5,1,0.5);
  4. triple A1 = (0,sqrt(3),sqrt(13)), A2 = (-2,0,0), A3 = (2,0,0), A4 = (0,2*sqrt(3),0);
  5. triple P = (1,sqrt(3),0), H = (0,sqrt(3),0), T = (-1,sqrt(3)/2,sqrt(13)/2);
  6. currentpen=olive+green+linewidth(1);
  7. draw(A3--A4);
  8. draw(A4--A2);
  9. draw(A1--A2);
  10. draw(A1--A3);
  11. draw(A1--A4);
  12. currentpen = dashed+OliveGreen+linewidth(1);
  13. draw(A2--A3);
  14. currentpen = purple+linewidth(1);
  15. draw(A1--P);
  16. currentpen = dashed+purple+linewidth(1);
  17. draw(A3--T);
  18. draw(H--A1);
  19. draw(H--A2);
  20. draw(H--A3);
  21. draw(H--A4);
  22. currentpen = blue+fontsize(8);
  23. label("$A_1$",A1,N);
  24. label("$A_2$",A2,E);
  25. label("$A_3$",A3,W);
  26. label("$A_4$",A4,SE);
  27. currentpen = purple+fontsize(8);
  28. label("$P$",P,SW);
  29. label("$T$",T,E);
  30. label("$H$",H,SW);
  31. \end{asy}
复制代码


我想用的颜色是OliveGreen,但这个画出来就是黑色的,怎么才能用这种颜色呢?

我试过改成olive+green,但也不管用。

3149

主题

8386

回帖

6万

积分

$\style{scale:11;fill:#eff}꩜$

积分
65391
QQ

显示全部楼层

hbghlyj 发表于 2023-7-2 19:56
Pens.html: the standard 68 CMYK TeX colors can be imported with the command import texcolors;

3149

主题

8386

回帖

6万

积分

$\style{scale:11;fill:#eff}꩜$

积分
65391
QQ

显示全部楼层

hbghlyj 发表于 2023-7-2 19:57

LaTeX/Colors

Wikibook
NameColorHexHueSaturationLightness
OliveGreen                     3C8031111.6113.888.5

413

主题

1558

回帖

1万

积分

积分
11498

显示全部楼层

 楼主| abababa 发表于 2023-7-2 21:01
hbghlyj 发表于 2023-7-2 19:56
Pens.html: the standard 68 CMYK TeX colors can be imported with
the command import texcolors;

这个我其实引用了,只是在一个总的公共文件里。虽然引用了,但实际上使用并没有效果,只画平面图没问题,而像主楼那样画一个立体的,就变成黑色的了。

3149

主题

8386

回帖

6万

积分

$\style{scale:11;fill:#eff}꩜$

积分
65391
QQ

显示全部楼层

hbghlyj 发表于 2023-7-3 00:52
本帖最后由 hbghlyj 于 2023-7-3 01:06 编辑 推荐 CTeX 临时论坛,通过 GitHub Issues 进行提问、回答与讨论。
Telegram群组很活跃

3149

主题

8386

回帖

6万

积分

$\style{scale:11;fill:#eff}꩜$

积分
65391
QQ

显示全部楼层

hbghlyj 发表于 2023-7-30 12:41
abababa 发表于 2023-7-2 21:01
这个我其实引用了,只是在一个总的公共文件里。虽然引用了,但实际上使用并没有效果,只画平面图没问题, ...

在3D中修改currentpen似乎有问题,把
  1. currentpen=olive+green+linewidth(1);
  2. draw(A3--A4);
复制代码
改成
  1. draw(A3--A4, olive+green+linewidth(1));
复制代码
估计就可以了

手机版|悠闲数学娱乐论坛(第3版)

GMT+8, 2025-3-4 12:31

Powered by Discuz!

× 快速回复 返回顶部 返回列表