This source did not publish a separate summary. Review SKILL.md before using the skill.
SKILL.md
Color Accessibility Guide
Design data visualizations that are accessible to colorblind readers and follow best practices for clarity, using tested palettes and encoding principles.
Color Vision Deficiency Overview
Approximately 8% of males and 0.5% of females have some form of color vision deficiency (CVD). The most common types:
Type
Prevalence (Male)
Affected Colors
Commonly Confused
Deuteranomaly (green-weak)
5%
Green
Red and green
Protanomaly (red-weak)
1%
Red
Red and green
Deuteranopia (no green)
1%
Green
Red and green
Protanopia (no red)
1%
Red
Red and green
Tritanopia (no blue)
0.003%
Blue
Blue and yellow
Monochromacy
Very rare
All
All colors
Key takeaway: Never rely solely on a red-green distinction to convey information. About 1 in 12 male readers cannot distinguish them.
For continuous data, use perceptually uniform colormaps:
import matplotlib.pyplot as plt
# Recommended sequential colormaps
# These are perceptually uniform and colorblind-safe:
good_cmaps = ["viridis", "plasma", "inferno", "magma", "cividis"]
# Avoid these (not perceptually uniform, not colorblind-safe):
bad_cmaps = ["jet", "rainbow", "hsv"] # NEVER use these
# Example usage
import numpy as np
data = np.random.randn(10, 10)
fig, ax = plt.subplots(figsize=(8, 6))
im = ax.imshow(data, cmap="viridis")
plt.colorbar(im)
plt.title("Use viridis, not jet")
plt.savefig("heatmap.pdf", dpi=300, bbox_inches="tight")
from colorspacious import cspace_convert
import numpy as np
def simulate_cvd(rgb_hex, deficiency="deuteranomaly", severity=100):
"""Simulate how a color appears to someone with CVD."""
# Convert hex to RGB [0,1]
rgb = np.array([int(rgb_hex[i:i+2], 16)/255 for i in (1, 3, 5)])
# Convert using colorspacious
cvd_space = {"name": "sRGB1+CVD",
"cvd_type": deficiency,
"severity": severity}
rgb_cvd = cspace_convert(rgb, cvd_space, "sRGB1")
rgb_cvd = np.clip(rgb_cvd, 0, 1)
return "#{:02x}{:02x}{:02x}".format(*[int(c*255) for c in rgb_cvd])
# Test your palette
for color in ["#FF0000", "#00FF00", "#0072B2", "#D55E00"]:
sim = simulate_cvd(color)
print(f"{color} -> {sim} (deuteranomaly)")
Quick Reference: Do's and Don'ts
Do
Don't
Use Wong or Okabe-Ito palettes
Use red vs. green to distinguish categories
Use viridis/cividis colormaps
Use jet/rainbow colormaps
Add shape/pattern as redundant encoding
Rely on color alone
Use direct labels when possible
Force readers to match colors to legend repeatedly