tinyrelayfile
tinyrelay/internal/seedmark/families_b.go/

internal/seedmark/families_b.go raw
1package seedmark
2
3import "fmt"
4
5func landscapes(r recipe) string {
6 bg, light, hot, cool := r.Palette[0], r.Palette[1], r.Palette[2], r.Palette[3]
7 s, h := r.Silhouette.Variant, r.Silhouette.Height
8 f, accent := r.Features.Variant, r.Features.Accent
9 horizon := 31 + (float64(h)-28)/2
10 art := []string{
11 circle(22, 19, 9, hot),
12 circle(43, 19, 10, hot),
13 rect(14, 12, 34, 9, 4, hot),
14 circle(32, 21, 15, hot),
15 }[r.Layout.Variant]
16 art += []string{
17 path("M7 46L21 22L33 37L43 26L57 46V55H7Z", cool),
18 path(fmt.Sprintf("M7 %sQ18 21 31 %sQ46 22 57 35V55H7Z", num(horizon), num(horizon)), cool),
19 path("M8 53V25H20V38H30V19H40V32H55V53Z", cool),
20 path("M7 36L18 28L26 32L39 23L57 33V55H7Z", cool),
21 }[s]
22 if f == 0 {
23 art += path("M31 35L24 45L36 45L28 55H42L45 43L33 43L37 35Z", light)
24 }
25 if f == 1 {
26 art += strokePath("M9 45Q21 40 32 46T55 46M13 53Q23 48 35 53", "none", light, 4)
27 }
28 if f == 2 {
29 art += strokePath("M18 48V35M12 42L18 32L24 42ZM42 50V38M36 43L42 33L48 43Z", light, light, 2)
30 }
31 if f == 3 {
32 art += rect(26, 36, 15, 17, 2, light) + path("M23 36L33 27L44 36Z", light) + rect(31, 43, 5, 10, 0, bg)
33 }
34 if accent != 0 {
35 art += strokePath("M9 18Q13 13 17 18Q21 13 25 18", "none", light, 2)
36 } else {
37 art += circle(51, 12, 3, light)
38 }
39 return art
40}
41
42func glyphs(r recipe) string {
43 bg, light, hot, cool := r.Palette[0], r.Palette[1], r.Palette[2], r.Palette[3]
44 w := float64(r.Silhouette.Width)
45 f, accent := r.Features.Variant, r.Features.Accent
46 art := []string{
47 circle(32, 32, 24, cool) + circle(32, 32, 18, bg),
48 rect(10, 10, 44, 44, 10, cool) + rect(16, 16, 32, 32, 5, bg),
49 strokePath("M10 26L26 10M38 10L54 26M54 38L38 54M26 54L10 38", "none", cool, 6),
50 strokePath("M10 47V17H24M54 17V47H40", "none", cool, 6),
51 }[r.Layout.Variant]
52 a, b := 32-w/2+4, 64-(32-w/2+4)
53 art += []string{
54 strokePath(fmt.Sprintf("M%s 43L32 17L%s 43M24 35H40", num(a), num(b)), "none", light, 7),
55 strokePath(fmt.Sprintf("M%s 22H%sL%s 43H%s", num(a), num(b), num(a), num(b)), "none", light, 7),
56 strokePath(fmt.Sprintf("M%s 19V44H%sV19M32 20V39", num(a), num(b)), "none", light, 7),
57 path("M21 18H37Q49 24 37 32Q50 40 38 46H21Z", light) + rect(27, 24, 9, 5, 2, bg) + rect(27, 36, 10, 5, 2, bg),
58 }[r.Silhouette.Variant]
59 art += []string{
60 circle(32, 32, 5, hot),
61 path("M32 24L40 32L32 40L24 32Z", hot),
62 rect(26, 27, 12, 10, 2, hot),
63 strokePath("M22 37L42 27", "none", hot, 6),
64 }[f]
65 if accent != 0 {
66 art += circle(49, 15, 4, light)
67 } else {
68 art += circle(15, 49, 4, light)
69 }
70 return art
71}
72
73func woven(r recipe) string {
74 bg, light, hot, cool := r.Palette[0], r.Palette[1], r.Palette[2], r.Palette[3]
75 s, w := r.Silhouette.Variant, float64(r.Silhouette.Width)
76 f, count := r.Features.Variant, r.Features.Count
77 gap := 10 + (w-26)/6
78 art := ""
79 if s == 0 {
80 for i := 0; i < 3; i++ {
81 fill := light
82 if i%2 != 0 {
83 fill = hot
84 }
85 art += rect(13+float64(i)*gap, 10, 7, 44, 3, fill)
86 }
87 for i := 0; i < 3; i++ {
88 art += rect(9, 16+float64(i)*gap, 45, 6, 2, cool)
89 }
90 art += rect(24, 23, 7, 15, 2, hot)
91 }
92 if s == 1 {
93 for i := 0; i < 3; i++ {
94 colors := []string{light, hot, cool}
95 x := 12 + i*12
96 art += strokePath(fmt.Sprintf("M%d 12L%d 25L%d 39L%d 52", x, x+8, x, x+8), "none", colors[i], 8)
97 }
98 }
99 if s == 2 {
100 art += strokePath("M12 20Q12 11 22 11H43Q52 11 52 21V43Q52 53 42 53H22Q12 53 12 43Z", "none", light, 6)
101 art += strokePath("M21 10V44H43V20H10M54 32H32V54", "none", hot, 7)
102 art += rect(28, 22, 8, 8, 1, cool)
103 }
104 if s == 3 {
105 for i := 0; i < 3; i++ {
106 colors := []string{light, hot, cool}
107 y := 18 + i*13
108 art += path(fmt.Sprintf("M10 %dL22 %dL34 %dL46 %dL54 %dL46 %dL34 %dL22 %dZ", y, 10+i*13, y, 10+i*13, y, 26+i*13, y, 26+i*13), colors[i])
109 }
110 }
111 art = group(art, fmt.Sprintf("rotate(%d 32 32) scale(.88) translate(4.36 4.36)", r.Layout.Variant*45))
112 art += []string{
113 circle(32, 32, 5, bg) + circle(32, 32, 2, light),
114 rect(26, 26, 12, 12, 3, hot),
115 path("M32 24L40 32L32 40L24 32Z", cool),
116 strokePath("M27 28L37 36M37 28L27 36", "none", bg, 4),
117 }[f]
118 for i := 0; i < count; i++ {
119 art += circle(18+float64(i)*7, 56, 2, hot)
120 }
121 return art
122}
123
124func machines(r recipe) string {
125 bg, light, hot, cool := r.Palette[0], r.Palette[1], r.Palette[2], r.Palette[3]
126 s, w := r.Silhouette.Variant, float64(r.Silhouette.Width)
127 f, count, accent := r.Features.Variant, r.Features.Count, r.Features.Accent
128 x := 32 - w/2
129 art := []string{
130 strokePath("M22 23L17 11M42 23L49 11", "none", hot, 4) + circle(17, 11, 4, light),
131 rect(23, 9, 18, 16, 4, hot) + rect(28, 12, 8, 6, 1, bg),
132 strokePath("M12 27L8 39L19 44M51 27L56 39L47 44", "none", hot, 6),
133 circle(22, 49, 8, hot) + circle(43, 49, 8, hot),
134 }[r.Layout.Variant]
135 art += []string{
136 rect(x, 20, w, 30, 5, light),
137 path(fmt.Sprintf("M%s 19H%sL%s 45L41 52H23L%s 45Z", num(x+5), num(59-x), num(64-x), num(x)), light),
138 ellipse(32, 35, w/2, 18, light),
139 path("M23 17H41L52 29V44L41 52H23L12 44V29Z", light),
140 }[s]
141 if f == 0 {
142 art += circle(32, 34, 11, bg) + circle(32, 34, 7, cool) + circle(35, 31, 3, light)
143 }
144 if f == 1 {
145 art += rect(20, 26, 24, 17, 3, bg) + strokePath("M24 37L29 30L34 36L40 29", "none", cool, 3)
146 }
147 if f == 2 {
148 art += rect(19, 25, 26, 15, 2, bg)
149 for i := 0; i < count; i++ {
150 art += rect(22+float64(i)*4, 28, 2, 9, 1, cool)
151 }
152 }
153 if f == 3 {
154 art += circle(25, 32, 6, bg) + circle(39, 32, 6, bg) + strokePath("M20 44H44", "none", hot, 4)
155 }
156 if accent != 0 {
157 art += circle(43, 46, 3, hot)
158 } else {
159 art += circle(21, 46, 3, hot)
160 }
161 return art
162}

About

ownerc01503e8035f
visibilitypublic
headd730679639bf

Maintainers

  • c01503e8035f owner
  • ba1b5beed5b5 agent hermes

Clone

  • https://012.run/npub1cq2s86qrtadf36eqq3epm38wmhdynrrcwxf84eldk3f94dkv7ttsrulrz5/tinyrelay.git

Refs