-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
423 additions
and
6 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,3 +4,5 @@ | |
/Manifest.toml | ||
/docs/Manifest.toml | ||
/docs/build/ | ||
|
||
/docs/src/examples/*.md |
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,9 @@ | ||
[deps] | ||
CairoMakie = "13f3f980-e62b-5c42-98c6-ff1f3baf88f0" | ||
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4" | ||
DocumenterInterLinks = "d12716ef-a0f6-4df4-a9f1-a5a34e75c656" | ||
Literate = "98b081ad-f1c9-55d3-8b20-4c87d4299306" | ||
PrideColorSchemes = "61d02e3d-8de9-45ce-a87b-73174b99cb55" | ||
|
||
[compat] | ||
Literate = "2.18" |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# # Use with Makie.jl | ||
|
||
using CairoMakie | ||
using PrideColorSchemes | ||
|
||
# The palettes defined in [`PROUD_PALETTES`](@ref) can be used to set colors in | ||
# | ||
# [Makie](https://github.com/MakieOrg/Makie.jl) plots. | ||
# | ||
# For example, | ||
|
||
x = 0:1e-2:2π | ||
lines(x, cos, color = PROUD_PALETTES[:rainbow][1]) | ||
lines!(x, sin, color = PROUD_PALETTES[:rainbow][2]) | ||
|
||
current_figure() | ||
|
||
# They can also be used to set the palette for a whole plot. | ||
# This can be simpler than setting colors one plot at a time. | ||
|
||
p = PROUD_PALETTES[:rainbow] | ||
|
||
fig = Figure() | ||
ax = Axis(fig[1, 1], palette = (patchcolor = p,)) | ||
|
||
for (i, _) in enumerate(p) | ||
y = @. sin(x) + i - 1 | ||
band!(ax, x, y, y .+ 1,) | ||
end | ||
|
||
fig |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,86 @@ | ||
""" | ||
Colour palettes | ||
For flags composed of horizontal stripes, the colors in each array are ordered from bottom to top. | ||
This results in color bars with an intuitive order. | ||
""" | ||
module PrideColorSchemes | ||
|
||
# Write your package code here. | ||
import Colors | ||
using Colors: @colorant_str | ||
|
||
export PROUD_PALETTES | ||
|
||
const bi = [colorant"#0038A8", colorant"#9B4F96", colorant"#D60270"] | ||
|
||
const pan = [colorant"#21B1FF", colorant"#FFD800", colorant"#FF218C"] | ||
|
||
pride6 = [ | ||
colorant"#750787", | ||
colorant"#004DFF", | ||
colorant"#008026", | ||
colorant"#FFED00", | ||
colorant"#FF8C00", | ||
colorant"#E40303", | ||
] | ||
|
||
pride8 = [ | ||
colorant"violet", | ||
colorant"indigo", | ||
colorant"turquoise", | ||
colorant"green", | ||
colorant"yellow", | ||
colorant"orange", | ||
colorant"red", | ||
colorant"pink", | ||
] | ||
|
||
pride7 = pride8[begin:end-1] | ||
|
||
trans = [ | ||
colorant"#5BCEFA", | ||
colorant"#F5A9B8", | ||
colorant"#FFFFFF", | ||
colorant"#F5A9B8", | ||
colorant"#5BCEFA", | ||
] | ||
|
||
""" | ||
const PROUD_PALETTES::Dict{Symbol,Vector{Colors.RGB}} | ||
`Dict` of RGB vectors. | ||
# Examples | ||
```jldoctest | ||
julia> using PrideColorSchemes | ||
julia> PROUD_PALETTES[:pride] | ||
6-element Array{RGB,1} with eltype ColorTypes.RGB: | ||
RGB{N0f8}(0.459,0.027,0.529) | ||
RGB{N0f8}(0.0,0.302,1.0) | ||
RGB{N0f8}(0.0,0.502,0.149) | ||
RGB{N0f8}(1.0,0.929,0.0) | ||
RGB{N0f8}(1.0,0.549,0.0) | ||
RGB{N0f8}(0.894,0.012,0.012) | ||
``` | ||
""" | ||
const PROUD_PALETTES = Dict{Symbol,Vector{Colors.RGB}}( | ||
:bi => bi, | ||
:nonbinary => | ||
[colorant"#2C2C2C", colorant"#9C59D1", colorant"#FFFFFF", colorant"#FFF430"], | ||
:pan => pan, | ||
:pride => pride6, | ||
:pride6 => pride6, | ||
:pride7 => pride7, | ||
:pride8 => pride8, | ||
:pride_progress => | ||
[pride6..., trans[begin:begin+3]..., colorant"brown", colorant"black"], | ||
:trans => trans, | ||
:rainbow => pride6, | ||
) | ||
|
||
include("precompile.jl") | ||
|
||
end |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import PrecompileTools | ||
|
||
PrecompileTools.@compile_workload begin | ||
for c in PROUD_PALETTES[:bi] | ||
display(c) | ||
end | ||
end |
Oops, something went wrong.