summaryrefslogtreecommitdiff
path: root/tools/icons/expand.py
blob: 854bbc6a62a1280508d9d6922bebceccfce425c8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#!/usr/bin/env python

import cairo
import sys


WIDTH, HEIGHT = 256, 256
WIDTH, HEIGHT = 12, 12

surface = cairo.ImageSurface(cairo.FORMAT_ARGB32, WIDTH, HEIGHT)
ctx = cairo.Context(surface)

ctx.scale(WIDTH, HEIGHT)

if len(sys.argv) > 1 and sys.argv[1] == '--dark':
    ctx.set_source_rgb(1.0, 1.0, 1.0)
    dark = '_dark'
else:
    ctx.set_source_rgb(0.0, 0.0, 0.0)
    dark = ''

ctx.move_to(0.0, 0.0)
ctx.line_to(0.4, 0.0)
ctx.line_to(0.0, 0.4)

ctx.fill()

ctx.move_to(1.0, 0.0)
ctx.line_to(0.6, 0.0)
ctx.line_to(1.0, 0.4)

ctx.fill()

ctx.move_to(1.0, 1.0)
ctx.line_to(1.0, 0.6)
ctx.line_to(0.6, 1.0)

ctx.fill()

ctx.move_to(0.0, 1.0)
ctx.line_to(0.4, 1.0)
ctx.line_to(0.0, 0.6)

ctx.fill()

surface.write_to_png('../../pixmaps/expand%s.png' % dark)