-
Notifications
You must be signed in to change notification settings - Fork 7
/
style.jl
38 lines (34 loc) · 941 Bytes
/
style.jl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# Color theme definitions
struct CyclicContainer <: AbstractVector{String}
c::Vector{String}
n::Int
end
CyclicContainer(c) = CyclicContainer(c, 0)
Base.length(c::CyclicContainer) = length(c.c)
Base.size(c::CyclicContainer) = size(c.c)
Base.iterate(c::CyclicContainer, state=1) = iterate(c.c, state)
Base.getindex(c::CyclicContainer, i) = c.c[(i-1)%length(c.c) + 1]
Base.getindex(c::CyclicContainer, i::AbstractArray) = c.c[i]
function Base.getindex(c::CyclicContainer)
c.n += 1
c[c.n]
end
Base.iterate(c::CyclicContainer, i = 1) = iterate(c.c, i)
COLORSCHEME = [
"#7143E0",
"#191E44",
"#0A9A84",
"#AF9327",
"#791457",
"#6C768C",
]
COLORS = CyclicContainer(COLORSCHEME)
LINESTYLES = CyclicContainer(["-", ":", "--", "-."])
# other styling elements for Makie
set_theme!(;
palette = (color = COLORSCHEME,),
fontsize = 22,
figure_padding = 8,
size = (800, 400),
linewidth = 3.0,
)