5namespace stackchan::display
7 void drawBubble(M5Canvas &canvas, uint32_t x, uint32_t y, uint32_t r,
8 uint16_t color,
float offset)
10 r = r + floor(r * 0.2 * offset);
11 canvas.drawCircle(x, y, r, color);
12 canvas.drawCircle(x - (r / 4), y - (r / 4), r / 4, color);
15 void drawBubble(M5Canvas &canvas, uint32_t x, uint32_t y, uint32_t r,
18 drawBubble(canvas, x, y, r, color, 0);
21 void drawWaterDrop(M5Canvas &canvas, uint32_t x, uint32_t y, uint32_t r,
22 uint16_t color,
float offset)
24 y = y + floor(5 * offset);
25 r = r + floor(r * 0.2 * offset);
26 canvas.fillCircle(x, y, r, color);
27 uint32_t a = (sqrt(3) * r) / 2;
28 canvas.fillTriangle(x, y - r * 2, x - a, y - r * 0.5, x + a, y - r * 0.5,
32 void drawWaterDrop(M5Canvas &canvas, uint32_t x, uint32_t y, uint32_t r,
35 drawWaterDrop(canvas, x, y, r, color, 0);
38 void drawPaleMark(M5Canvas &canvas, uint32_t x, uint32_t y, uint32_t r,
39 uint16_t color,
float offset)
41 uint32_t h = r + abs(r * 0.2 * offset);
42 canvas.fillRect(x - (r / 2), y, 3, h / 2, color);
43 canvas.fillRect(x, y, 3, h * 3 / 4, color);
44 canvas.fillRect(x + (r / 2), y, 3, h, color);
47 void drawPaleMark(M5Canvas &canvas, uint32_t x, uint32_t y, uint32_t r,
50 drawPaleMark(canvas, x, y, r, color, 0);
53 void drawAngerMark(M5Canvas &canvas, uint32_t x, uint32_t y, uint32_t r,
54 uint16_t color, uint16_t background_color,
float offset)
56 r = r + abs(r * 0.4 * offset);
57 canvas.fillRect(x - (r / 3), y - r, (r * 2) / 3, r * 2, color);
58 canvas.fillRect(x - r, y - (r / 3), r * 2, (r * 2) / 3, color);
59 canvas.fillRect(x - (r / 3) + 2, y - r, ((r * 2) / 3) - 4, r * 2, background_color);
60 canvas.fillRect(x - r, y - (r / 3) + 2, r * 2, ((r * 2) / 3) - 4, background_color);
63 void drawAngerMark(M5Canvas &canvas, uint32_t x, uint32_t y, uint32_t r,
64 uint16_t color, uint16_t background_color)
66 drawAngerMark(canvas, x, y, r, color, background_color, 0);
69 void drawHeart(M5Canvas &canvas, uint32_t x, uint32_t y, uint32_t r,
70 uint16_t color,
float offset)
72 r = r + floor(r * 0.4 * offset);
73 canvas.fillCircle(x - r / 2, y, r / 2, color);
74 canvas.fillCircle(x + r / 2, y, r / 2, color);
75 float a = (sqrt(2) * r) / 4.0;
76 canvas.fillTriangle(x, y, x - r / 2 - a, y + a, x + r / 2 + a, y + a, color);
77 canvas.fillTriangle(x, y + (r / 2) + 2 * a, x - r / 2 - a, y + a,
78 x + r / 2 + a, y + a, color);
81 void drawHeart(M5Canvas &canvas, uint32_t x, uint32_t y, uint32_t r,
84 drawHeart(canvas, x, y, r, color, 0);