Pride Flag Palettes ◈
Gay.jl provides accurate color palettes for pride flags, available in any supported color space.
Setup
using Gay
using Colors: RGBClassic Rainbow ◈
Gilbert Baker's 1978 design — the original six-stripe flag.
println("=== Rainbow Flag ===")
show_colors(rainbow())
show_palette(rainbow())=== Rainbow Flag ===
████████████
████ #E40303 ████ #FF8C00 ████ #FFED00 ████ #008026 ████ #004CAF ████ #750787In Different Color Spaces
println("\n=== Rainbow in Different Color Spaces ===")
println("sRGB:")
show_colors(rainbow(SRGB()))
println("Display P3:")
show_colors(rainbow(DisplayP3()))
println("Rec.2020:")
show_colors(rainbow(Rec2020()))
=== Rainbow in Different Color Spaces ===
sRGB:
████████████
Display P3:
████████████
Rec.2020:
████████████Transgender Flag ◇◈◇
println("\n=== Transgender Flag ===")
show_colors(transgender())
show_palette(transgender())
=== Transgender Flag ===
██████████
████ #5BCEFA ████ #F5A8B7 ████ #FFFFFF ████ #F5A8B7 ████ #5BCEFABisexual Flag
println("\n=== Bisexual Flag ===")
show_colors(bisexual())
show_palette(bisexual())
=== Bisexual Flag ===
██████
████ #D70270 ████ #9C598A ████ #0038A7Nonbinary Flag
println("\n=== Nonbinary Flag ===")
show_colors(nonbinary())
show_palette(nonbinary())
=== Nonbinary Flag ===
████████
████ #FCF42F ████ #FFFFFF ████ #9C59D1 ████ #2E2E2EPansexual Flag
println("\n=== Pansexual Flag ===")
show_colors(pansexual())
show_palette(pansexual())
=== Pansexual Flag ===
██████
████ #FF218C ████ #FFD800 ████ #21B1FFAsexual Flag
println("\n=== Asexual Flag ===")
show_colors(asexual())
show_palette(asexual())
=== Asexual Flag ===
████████
████ #000000 ████ #A3A3A3 ████ #FFFFFF ████ #800080Generic Access via pride_flag
println("\n=== Flags via pride_flag() ===")
println("Rainbow: ", length(pride_flag(:rainbow)), " colors")
println("Trans: ", length(pride_flag(:trans)), " colors")
=== Flags via pride_flag() ===
Rainbow: 6 colors
Trans: 5 colorsUsing Pride Colors in Visualizations
println("\n=== Pride Colors for Data Viz ===")
categories = ["A", "B", "C", "D", "E", "F"]
colors = rainbow()
println("Categorical mapping:")
for (cat, color) in zip(categories, colors)
println(" Category $cat -> ", color)
end
=== Pride Colors for Data Viz ===
Categorical mapping:
Category A -> RGB{Float64}(0.894,0.012,0.012)
Category B -> RGB{Float64}(1.0,0.549,0.0)
Category C -> RGB{Float64}(1.0,0.929,0.0)
Category D -> RGB{Float64}(0.0,0.502,0.149)
Category E -> RGB{Float64}(0.0,0.298,0.686)
Category F -> RGB{Float64}(0.459,0.027,0.529)Creating Custom Pride-Inspired Palettes
gay_seed!(42)
println("\n=== Custom Pride-Inspired Palette ===")
println("Rainbow base + random variations:")
base_rainbow = rainbow()
custom = RGB{Float64}[]
for c in base_rainbow
nc = next_color()
push!(custom, RGB(
clamp(c.r * 0.8 + nc.r * 0.2, 0, 1),
clamp(c.g * 0.8 + nc.g * 0.2, 0, 1),
clamp(c.b * 0.8 + nc.b * 0.2, 0, 1)
))
end
show_palette(custom)
=== Custom Pride-Inspired Palette ===
Rainbow base + random variations:
████ #B62802 ████ #FF7007 ████ #CCC300 ████ #336632 ████ #004A93 ████ #5E116CThe custom palette is reproducible!
gay_seed!(42)
custom2 = RGB{Float64}[]
for c in base_rainbow
nc = next_color()
push!(custom2, RGB(
clamp(c.r * 0.8 + nc.r * 0.2, 0, 1),
clamp(c.g * 0.8 + nc.g * 0.2, 0, 1),
clamp(c.b * 0.8 + nc.b * 0.2, 0, 1)
))
end
@assert custom == custom2
println("◆ Custom pride palette is reproducible")
println("\n◆ Pride palettes example complete ◈")◆ Custom pride palette is reproducible
◆ Pride palettes example complete ◈