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 (13 lines) | stat: -rwxr-xr-x 336 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
#!/usr/bin/env python
import sys
sys.path[:0] = [".."]
from pyx import *

c = canvas.canvas()
c.fill(path.rect(0, 0, 7, 3), [color.gray(0.8)])
c.fill(path.rect(1, 1, 1, 1), [color.rgb.red])
c.fill(path.rect(3, 1, 1, 1), [color.rgb.green])
c.fill(path.rect(5, 1, 1, 1), [color.rgb.blue])
c.writeEPSfile("color")
c.writePDFfile("color")