Skip to content

Logo idea #41

@cvigilv

Description

@cvigilv

I think it's time for this, I would try to start wrapping up some minor stuff so people can start tinkering with the package. I came up with this playing around today:

Square style

Image

Circular style

Image

I implemented this in a Pluto notebook, but this is the code:

using CairoMakie
using Colors
using Random

logocolors = Colors.JULIA_LOGO_COLORS |> values |> collect

# Square style
f = Figure()
ax = Axis(f[1,1], aspect = 1)
H = rand(20, 20) .> 0.4
	
x = H |> CartesianIndices |> vec |> collect |> i -> map(x -> (x[1]), i)
y = H |> CartesianIndices |> vec |> collect |> i -> map(x -> (x[2]), i)
z = H |> vec

scatter!(
	ax,
	x[z .== true],
	y[z .== true], 
	color = rand(1:4, sum(z)); 
	colormap = logocolors,
	markersize = 20
)

hidedecorations!(ax)
hidespines!(ax)
f

# Circular style
f = Figure()
ax = Axis(f[1,1], aspect = 1)

H = rand(20, 20) .> 0.4

center = (size(H, 1) + 1) / 2, (size(H, 2) + 1) / 2
radius = min(size(H)...) / 2

indices = CartesianIndices(H)
circular_mask = [sqrt((i[1] - center[1])^2 + (i[2] - center[2])^2) <= radius 
                     for i in indices]

H_circular = H .& circular_mask
    
x = H_circular |> CartesianIndices |> vec |> collect |> i -> map(x -> (x[1]), i)
y = H_circular |> CartesianIndices |> vec |> collect |> i -> map(x -> (x[2]), i)
z = H_circular |> vec
    
scatter!(
    ax,
    x[z .== true]
    y[z .== true], 
    color = (rand(1:4, length(z)))[z .== true]; 
    colormap = logocolors,
    markersize=20,
)
    
hidedecorations!(ax)
hidespines!(ax)
f

LMKWYT

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions