-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathlogo.py
71 lines (60 loc) · 1.96 KB
/
logo.py
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
from board_config import display_drv
from palettes import get_palette
import graphics
def main():
pal = get_palette("material_design")
CENTER_X = display_drv.width // 2
CENTER_Y = display_drv.height // 2
BASE_UNIT = min([display_drv.width, display_drv.height]) // 2
# Draw the 3 concentric circles
graphics.circle(display_drv, CENTER_X, CENTER_Y, BASE_UNIT, pal.BLUE_S900, True)
graphics.circle(display_drv, CENTER_X, CENTER_Y, int(BASE_UNIT * 0.9), pal.BLACK, True)
graphics.circle(display_drv, CENTER_X, CENTER_Y, int(BASE_UNIT * 0.8), pal.AMBER_S500, True)
# Draw the outer rounded rectangle
LEFT_X = int(CENTER_X - (BASE_UNIT * 1.2) // 2)
TOP_Y = int(CENTER_Y - (BASE_UNIT * 1.0) // 2)
graphics.round_rect(
display_drv,
LEFT_X,
TOP_Y,
int(BASE_UNIT * 1.2),
int(BASE_UNIT * 1.0),
BASE_UNIT // 7,
pal.BLACK,
True,
)
# Draw the inner rounded rectangle
LEFT_X = int(CENTER_X - (BASE_UNIT * 1.1) // 2)
TOP_Y = int(CENTER_Y - (BASE_UNIT * 0.9) // 2)
graphics.round_rect(
display_drv,
LEFT_X,
TOP_Y,
int(BASE_UNIT * 1.1),
int(BASE_UNIT * 0.9),
BASE_UNIT // 9,
pal.AMBER_S100,
True,
)
# Draw the 2 small squares
LEFT_X = CENTER_X - (BASE_UNIT * 3 // 8)
TOP_Y = CENTER_Y - (BASE_UNIT * 3 // 8)
SIZE = BASE_UNIT // 4
graphics.fill_rect(display_drv, LEFT_X, TOP_Y, SIZE, SIZE, pal.BLACK)
graphics.fill_rect(
display_drv,
display_drv.width - (LEFT_X + SIZE),
display_drv.height - (TOP_Y + SIZE),
SIZE,
SIZE,
pal.BLACK,
)
# Draw the 2 small circles
SIZE = SIZE // 2
graphics.circle(
display_drv, display_drv.width - (LEFT_X + SIZE), TOP_Y + SIZE, SIZE, pal.BLACK, True
)
graphics.circle(
display_drv, LEFT_X + SIZE, display_drv.height - (TOP_Y + SIZE), SIZE, pal.BLACK, True
)
main()