Skip to content
Lanxu · OmniBio
All tools

Figure Palette Generator

Pick colors for Condition, cell type, time points and more: categorical variables share one palette with no repeated colors, ordered variables use viridis.

  • No sign-up
  • Runs locally

Variables

Categorical variables take colors top to bottom, so put Condition / Group first.

Comma-separated names, or just a count (1–100); to use a number as a name, add a comma, e.g. "3,"

Result

Click a swatch to copy its hex value

ConditionCategorical (unordered)

CelltypeCategorical (unordered)

TimeOrdered (e.g. time, dose)

Export

Condition_colors <- c("WT" = "#1F77B4", "KO" = "#FF7F0E")
Celltype_colors <- c("1" = "#2CA02C", "2" = "#D62728", "3" = "#9467BD", "4" = "#8C564B", "5" = "#E377C2", "6" = "#7F7F7F", "7" = "#BCBD22", "8" = "#17BECF")
Time_colors <- c("0h" = "#440154", "6h" = "#31688E", "24h" = "#35B779", "48h" = "#FDE725")

How to use

  1. Choose the categorical palette: D3 (up to 40 colors) or Okabe-Ito (color-blind friendly, 8 colors).
  2. For each variable enter a name and its levels: separate names with commas, or type just a count; pick “Ordered” for time or dose.
  3. Check the colors on the right and click a swatch to copy its hex value.
  4. Under Export switch between R, Python, CSV and HEX, then paste the code into your plotting script.

Notes

  • Categorical variables (Condition, cell type, cluster) draw from one shared palette in order, so one color never means two things in the same figure.
  • Ordered variables (time, dose) use the viridis sequential palette, purple to yellow-green in level order.
  • The code contains fixed hex values you can paste into R / Python; no package is required.

FAQ

Why do different categorical variables never share a color?

All categorical variables (Condition, cell type, cluster…) draw from one palette in order, so within a figure one color always means one thing.

Why use viridis for ordered variables such as time or dose?

viridis is a perceptually uniform sequential palette running from purple to yellow-green, so shade maps directly to order and stays readable in grayscale and for color-blind readers.

What if a variable has more levels than the palette has colors?

D3 has up to 40 colors and Okabe-Ito only 8. Extra levels are filled from D3 or generated automatically, with a warning that distinctness drops; merge categories if you have many.

Does the exported code need extra R or Python packages?

No. The code contains fixed hex values, so you can paste it into R or Python and get the same colors every time.