File: color.py

package info (click to toggle)
pyx 0.9-4
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 2,060 kB
  • ctags: 2,665
  • sloc: python: 15,205; makefile: 142; ansic: 131
file content (14 lines) | stat: -rw-r--r-- 403 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
from pyx import *
unit.set(uscale=2, xscale=2)

col = color.cmyk.PineGreen

text.set(mode="latex")
text.preamble("\usepackage{color}")
text.preamble(r"\definecolor{COL}{cmyk}{%(c)g,%(m)g,%(y)g,%(k)g}" % col.color)

c = canvas.canvas()
c.text(0, 0, r"\textcolor{COL}{Text} and outline have the same color")
c.stroke(path.rect(-0.2, -0.2, 6.2, 0.6), [col])
c.writeEPSfile("color")
c.writePDFfile("color")