Last active
November 28, 2023 10:11
-
-
Save cormullion/0e502b16e7e0f1607084c206d93e5cc5 to your computer and use it in GitHub Desktop.
a logo idea
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Luxor, Colors | |
# julia colors as extracted from the SVG | |
tidier_lighter_colors = [ | |
RGB(202 / 256, 60 / 256, 50 / 256), # lighter red | |
RGB(57 / 256, 151 / 256, 70 / 256), # lighter green | |
RGB(146 / 256, 89 / 256, 163 / 256), # lighter purple | |
RGB(76 / 256, 100 / 256, 176 / 256), # lighter blue | |
] | |
tidier_darker_colors = [ | |
RGB(171 / 256, 52 / 256, 43 / 256), # darker red | |
RGB(47 / 256, 122 / 256, 55 / 256), # darker green | |
RGB(121 / 256, 72 / 256, 137 / 256), # darker purple | |
RGB(63 / 256, 83 / 256, 146 / 256), # darker blue | |
] | |
#= | |
I think the tidier-julia colors are slightly different from the Julia colors | |
for n in eachindex(tidier_darker_colors) | |
@show colordiff(tidier_darker_colors[n], RGB.([Luxor.julia_red, Luxor.julia_green, Luxor.julia_purple, Luxor.julia_blue][n]...)) | |
end | |
=# | |
function tweezers(; | |
pos = O, | |
rotation = 0, | |
scalefactor = 0.5, | |
frontcolor = Union{String,nothing}, | |
backcolor = Union{String,nothing}) | |
@layer begin | |
translate(pos) | |
rotate(rotation) | |
scale(scalefactor) | |
pts = polysuper(O, n1 = 6.5, n2 = 4.4, n3 = 9.3, m = 2, a = 1.97, b = -10.0, radius = 16, vertices = true) | |
for i in 1:2 | |
if !isnothing([backcolor, frontcolor][i]) | |
sethue([backcolor, frontcolor][i]) | |
poly(pts, :fill) | |
col = getcolor() | |
sethue(RGB(col.r * 0.9, col.g * 0.9, col.b * 0.9)) | |
poly(pts, :stroke) | |
end | |
rotate(i * (π / 20)) | |
end | |
end | |
end | |
function main(fname) | |
Drawing(298, 329, fname) | |
origin() | |
# make shape | |
corners = ngon(O, 160, 6, π / 6, vertices = true) | |
bulgehex = makebezierpath(corners, smoothing = 0.15) | |
setblend(blend(O, 0, O, 140, | |
HSB(80, 0.3, 0.8), # center | |
HSB(80, 0.8, 0.6), # edge | |
)) | |
drawbezierpath(bulgehex, :fill) | |
sethue(HSB(80, 0.5, 0.8)) | |
setline(7) | |
drawbezierpath(bulgehex, :stroke) | |
# draw the package name | |
name = "TidierText.jl" | |
fontsize(42) | |
fontface("URWGothic-Demi") | |
textpath("TidierText.jl", O + (0, -44), halign = :center, action = :path) | |
pgs = pathtopoly() | |
sethue("white") | |
fillpath() | |
# colourize the Julia dots | |
dots_to_colour = [3, 7, 16, 18] # eg paths 3, 7, 16, 18 are 'tittles' | |
setline(1) | |
for (n, dot) in enumerate(pgs) | |
k = findfirst(isequal(n), dots_to_colour) | |
if !isnothing(k) | |
sethue(tidier_lighter_colors[mod1(k, end)]) | |
circle(polycentroid(pgs[n]), 4.5, :fillpreserve) | |
sethue(tidier_darker_colors[mod1(k, end)]) | |
strokepath() | |
end | |
end | |
# the tidying | |
drawbezierpath(bulgehex, :clip) | |
setline(1) | |
# tweezers, just the back first | |
tweezers(pos = O + (5, 130), rotation = deg2rad(120), scalefactor = 0.2, | |
backcolor = HSV(40, 0.5, 0.9), | |
frontcolor = nothing, | |
) | |
# text | |
setopacity(0.9) | |
textplace("tidier", O + (-125, 75), | |
[ | |
(size = 120, shift = 10, face = "URWGothic-Demi", color = colorant"azure"), # t | |
(size = 90, shift = 10), # i | |
(size = 130, shift = 5), # d | |
(size = 100, shift = 20), # i | |
(size = 80, shift = -5), # e | |
(size = 110, shift = 10), # r | |
], action = :fill, | |
) | |
# tweezers, front | |
setopacity(1.0) | |
tweezers(pos = O + (5, 130), rotation = deg2rad(118), scalefactor = 0.2, | |
backcolor = nothing, | |
frontcolor = HSB(30, 0.9, 0.9), | |
) | |
# cursor | |
setline(2) | |
sethue("gold") | |
circle(O + (-66, -20), 5, :fill) | |
line(O + (-66, -20), O + (-66, 100), :stroke) | |
circle(O + (-66, 100), 5, :fill) | |
clipreset() | |
finish() | |
preview() | |
end | |
main("/tmp/tidiertext-logo.svg") | |
# convert SVG to big PNG 1314 × 1475 | |
Drawing(1314, 1475, "/tmp/tidiertext-logo.png") | |
origin() | |
s = readsvg("/tmp/tidiertext-logo.svg") | |
w, h = s.width, s.height | |
sf = 1314/w | |
scale(sf) | |
placeimage(s, centered = true) | |
finish() | |
preview() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment