Skip to content

Commit 9076371

Browse files
authored
Add logo (#320)
* Add logo * Add dark logo * Rm gitkeep
1 parent ea9159b commit 9076371

File tree

4 files changed

+247
-1
lines changed

4 files changed

+247
-1
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# BenchmarkTools.jl
1+
# BenchmarkTools.jl <picture> <source media="(prefers-color-scheme: dark)" srcset="./docs/build/assets/logo-dark.svg" width="100" height="100"> <img alt="BenchmarkTools logo" src="./docs/build/assets/logo.svg" width="100" height="100"> </picture>
22

33
[![][docs-stable-img]][docs-stable-url]
44
[![][docs-dev-img]][docs-dev-url]

docs/generate_logo.jl

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
using Pkg
2+
Pkg.activate(; temp=true)
3+
Pkg.add("Luxor")
4+
using Luxor
5+
6+
JULIA_COLORS = [Luxor.julia_blue, Luxor.julia_green, Luxor.julia_red, Luxor.julia_purple]
7+
8+
function draw_logo(; path, dark=false)
9+
Drawing(500, 500, path)
10+
origin()
11+
squircle(O, 250, 250, :clip, rt=0.3)
12+
sethue(dark ? "black" : "white")
13+
paint()
14+
15+
@layer begin
16+
translate(0, 200)
17+
rmin = 150
18+
rmax = 260
19+
band = 40
20+
21+
for n in 1:4
22+
setblend(blend(O - (240, 0), O + (240, 0), "white", JULIA_COLORS[n]))
23+
sector(O,
24+
rescale(n, 1, 3, rmin, rmax),
25+
rescale(n, 1, 3, rmin, rmax) + band,
26+
3π / 2 - deg2rad(45), 3π / 2 + deg2rad(45),
27+
:fill)
28+
end
29+
30+
sethue(dark ? "black" : "white")
31+
setline(25)
32+
line(O, polar(400, deg2rad(290)), :strokepreserve)
33+
setline(14)
34+
sethue(dark ? "white" : "black")
35+
strokepath()
36+
circle(O, 30, :fill)
37+
end
38+
39+
finish()
40+
preview()
41+
end
42+
43+
draw_logo(path=joinpath(@__DIR__, "src", "assets", "logo.svg"), dark=false)
44+
draw_logo(path=joinpath(@__DIR__, "src", "assets", "logo-dark.svg"), dark=true)

0 commit comments

Comments
 (0)