diff --git a/.gitignore b/.gitignore index c7eb77b..b408b96 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,7 @@ *.jl.mem Manifest.toml /docs/build + +# automatically generated logo +/docs/src/assets/logo.png +/docs/src/assets/logo-dark.png diff --git a/docs/Project.toml b/docs/Project.toml index 05fdfd1..a270dd9 100644 --- a/docs/Project.toml +++ b/docs/Project.toml @@ -5,4 +5,5 @@ FileIO = "5789e2e9-d7fb-5bc7-8068-2c6fae9b9549" ImageCore = "a09fc81d-aa75-5fe9-8630-4744c3626534" ImageDraw = "4381153b-2b60-58ae-a1ba-fd683676385f" ImageMagick = "6218d12a-5da1-5696-b52f-db25d2ecc6d1" +Images = "916415d5-f1e6-5110-898d-aaa5f9f070e0" TestImages = "5e47fb64-e119-507b-a336-dd2b206d9990" diff --git a/docs/logo.jl b/docs/logo.jl new file mode 100644 index 0000000..bcc18f9 --- /dev/null +++ b/docs/logo.jl @@ -0,0 +1,47 @@ +function generate_logo() + # Load original image (from https://github.com/JuliaImages/juliaimages.github.io/blob/source/docs/src/assets/logo.png) + img = load(joinpath(@__DIR__, "logo_original.png")) + + # Define some colors + c_red, c_green, c_blue, c_purple = RGBA.([Colors.JULIA_LOGO_COLORS...]) + gray_dark = RGBA{N0f8}(0.1,0.1,0.1) + gray_light = RGBA{N0f8}(0.9,0.9,0.9) + + # Change base color black to gray + img = img*N0f8(0.5) .+ RGBA{N0f8}(0.5,0.5,0.5,0) + img_dark = copy(img) + img_light = copy(img) + + # Define points on the image + p_green = Point(87,35) + p_red = Point(75,55) + p_purple = Point(99,55) + p_1 = Point(13,96) + p_2 = Point(52,50) + p_3 = Point(73,73) + p_4 = Point(84,62) + p_5 = Point(116,97) + + # Define path + path_dark = joinpath(@__DIR__, "src", "assets", "logo-dark.png") + path_light = joinpath(@__DIR__, "src", "assets", "logo.png") + + for (img,gray,name) in ((img_dark,gray_light,path_dark), (img_light,gray_dark,path_light)) + draw!(img, LineTwoPoints(p_1,p_2), gray) + draw!(img, LineTwoPoints(p_2,p_3), gray) + draw!(img, LineTwoPoints(p_3,p_4), gray) + draw!(img, LineTwoPoints(p_4,p_5), gray) + + draw!(img, Cross(p_1,8), gray) + draw!(img, Cross(p_2,8), gray) + draw!(img, Cross(p_3,8), gray) + draw!(img, Cross(p_4,8), gray) + draw!(img, Cross(p_5,8), gray) + + draw!(img, Ellipse(CirclePointRadius(p_green,10)), c_green) + draw!(img, Ellipse(CirclePointRadius(p_red,10)), c_red) + draw!(img, Ellipse(CirclePointRadius(p_purple,10)), c_purple) + + save(name,img) + end +end diff --git a/docs/logo_original.png b/docs/logo_original.png new file mode 100644 index 0000000..e02807c Binary files /dev/null and b/docs/logo_original.png differ diff --git a/docs/make.jl b/docs/make.jl index 41905cd..63cc52c 100644 --- a/docs/make.jl +++ b/docs/make.jl @@ -1,4 +1,7 @@ -using Documenter, ImageDraw +using Documenter, Images, ImageDraw + +include("logo.jl") +generate_logo() makedocs(sitename="ImageDraw.jl", format = Documenter.HTML(prettyurls = get(ENV, "CI", nothing) == "true"))