Skip to content

Instantly share code, notes, and snippets.

@cormullion
Last active July 4, 2024 07:45
Show Gist options
  • Save cormullion/beec0a7bad38785406e01ecea8e09986 to your computer and use it in GitHub Desktop.
Save cormullion/beec0a7bad38785406e01ecea8e09986 to your computer and use it in GitHub Desktop.
Julia Gender Inclusive
using Luxor, Colors
function umbrella(pos;
colors = Colors.JULIA_LOGO_COLORS,
scalefactor = 1)
pink = parse(Colorant, "#FFAFC8")
lblue = parse(Colorant, "#74D7EE")
brown = parse(Colorant, "#613915")
@layer begin
scale(scalefactor)
translate(pos)
rotate(π / 6)
translate(-205, -190) # j tittle is now at center
# right
move(Point(269.379, 211.207))
curve(Point(276.871, 204.785), Point(298.285, 195.148), Point(318.09, 195.148))
curve(Point(331.477, 195.148), Point(352.891, 196.754), Point(362.527, 205.32))
curve(Point(359.312, 133.582), Point(304.707, 62.383), Point(211.023, 56.492))
curve(Point(254.387, 78.977), Point(269.379, 143.754), Point(269.379, 211.207))
closepath()
sethue(Luxor.julia_green)
fillpath()
# left
move(Point(128.047, 211.207))
curve(Point(129.117, 156.602), Point(145.176, 78.977), Point(187.469, 56.492))
curve(Point(94.855, 62.383), Point(39.711, 133.582), Point(36.5, 205.32))
curve(Point(45.066, 196.754), Point(67.016, 195.148), Point(80.934, 195.148))
curve(Point(99.672, 195.148), Point(120.016, 204.785), Point(128.047, 211.207))
closepath()
sethue(Luxor.julia_red)
fillpath()
# centre
move(Point(133.398, 217.633))
curve(Point(139.824, 211.207), Point(166.055, 201.035), Point(199.246, 201.035))
curve(Point(232.438, 201.035), Point(252.781, 205.32), Point(264.027, 217.633))
curve(Point(264.555, 135.727), Point(241.539, 69.879), Point(199.781, 56.492))
curve(Point(155.883, 70.949), Point(133.398, 143.754), Point(133.398, 217.633))
closepath()
sethue(Luxor.julia_purple)
fillpath()
# top of handle
move(Point(199.246, 227.27))
sethue(Luxor.julia_blue)
curve(Point(204.602, 227.27), Point(209.418, 222.449), Point(209.418, 217.098))
curve(Point(209.418, 211.207), Point(204.602, 206.391), Point(199.246, 206.391))
curve(Point(193.359, 206.391), Point(188.539, 211.207), Point(188.539, 217.098))
curve(Point(188.539, 222.449), Point(193.359, 227.27), Point(199.246, 227.27))
closepath()
fillpath()
move(Point(191.75, 250.289))
line(Point(207.277, 243.863))
line(Point(207.277, 231.551))
line(Point(191.75, 231.551))
closepath()
fillpath()
# band 1
move(Point(191.75, 265.812))
line(Point(207.277, 259.391))
line(Point(207.277, 248.684))
line(Point(191.75, 255.105))
closepath()
sethue(pink)
fillpath()
# band 2
move(Point(191.75, 280.805))
line(Point(207.277, 274.379))
line(Point(207.277, 264.207))
line(Point(191.75, 270.633))
closepath()
sethue(lblue)
fillpath()
# band 3
move(Point(191.75, 296.328))
line(Point(207.277, 289.906))
line(Point(207.277, 279.199))
line(Point(191.75, 285.621))
closepath()
sethue(brown)
fillpath()
# bottom handle
move(Point(207.277, 294.723))
line(Point(207.277, 311.32))
curve(Point(207.277, 334.875), Point(193.359, 342.902), Point(178.902, 342.902))
curve(Point(164.449, 342.902), Point(151.066, 333.27), Point(151.066, 309.176))
line(Point(166.055, 309.176))
curve(Point(166.055, 322.562), Point(172.48, 328.449), Point(178.902, 328.449))
curve(Point(184.793, 328.449), Point(191.75, 323.633), Point(191.75, 310.785))
line(Point(191.75, 301.148))
closepath()
sethue(Luxor.julia_blue)
fillpath()
end
end
function main()
Drawing(600, 600, "juliagi-logo.svg")
origin()
sethue("cyan")
squircle(O, 296, 296, rt = 0.44, action = :path)
squircle(O, 270, 270, rt = 0.44, reversepath = true, action = :path)
clip()
for (n, θ) in enumerate(range(0, 2π, step = π / 12))
sethue(HSL((360 / 24)n, 0.7, 0.6))
sector(O, 268, 390, θ, θ + π / 12, :fill)
end
clipreset()
squircle(O, 270, 270, rt = 0.44, action = :path)
clip()
sethue("grey10")
paint()
umbrella(O + (0, 5), scalefactor = 1.55)
finish()
preview()
end
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment