Forgot password?
 Create new account
View 141|Reply 5

Asymptote里怎么用xcolor里的颜色?

[Copy link]

418

Threads

1627

Posts

110K

Credits

Credits
11886

Show all posts

abababa Posted at 2023-6-30 20:45:00 |Read mode
如题,代码如下:
  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}
Copy the Code


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

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

3148

Threads

8489

Posts

610K

Credits

Credits
66148
QQ

Show all posts

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

3148

Threads

8489

Posts

610K

Credits

Credits
66148
QQ

Show all posts

hbghlyj Posted at 2023-7-2 19:57:22

LaTeX/Colors

Wikibook
NameColorHexHueSaturationLightness
OliveGreen                     3C8031111.6113.888.5

418

Threads

1627

Posts

110K

Credits

Credits
11886

Show all posts

 Author| abababa Posted at 2023-7-2 21:01:54
hbghlyj 发表于 2023-7-2 19:56
Pens.html: the standard 68 CMYK TeX colors can be imported with
the command import texcolors;
这个我其实引用了,只是在一个总的公共文件里。虽然引用了,但实际上使用并没有效果,只画平面图没问题,而像主楼那样画一个立体的,就变成黑色的了。

3148

Threads

8489

Posts

610K

Credits

Credits
66148
QQ

Show all posts

hbghlyj Posted at 2023-7-3 00:52:05
Last edited by hbghlyj at 2023-7-3 01:06:00推荐 CTeX 临时论坛,通过 GitHub Issues 进行提问、回答与讨论。
Telegram群组很活跃

3148

Threads

8489

Posts

610K

Credits

Credits
66148
QQ

Show all posts

hbghlyj Posted at 2023-7-30 12:41:25
abababa 发表于 2023-7-2 21:01
这个我其实引用了,只是在一个总的公共文件里。虽然引用了,但实际上使用并没有效果,只画平面图没问题, ...
在3D中修改currentpen似乎有问题,把
  1. currentpen=olive+green+linewidth(1);
  2. draw(A3--A4);
Copy the Code
改成
  1. draw(A3--A4, olive+green+linewidth(1));
Copy the Code
估计就可以了

手机版Mobile version|Leisure Math Forum

2025-4-20 12:00 GMT+8

Powered by Discuz!

× Quick Reply To Top Return to the list