rCTF Docs
Overview

Color system

Understanding and customizing the rCTF color system, including light/dark themes and semantic colors.

All colors in rCTF are defined using OKLCH. Colors are declared as CSS custom properties in apps/web/src/app.css, with :root containing light mode values and [data-theme='dark'] providing dark mode overrides. The theme is toggled via the data-theme attribute on <html>, persisted to localStorage, and respects prefers-color-scheme on first load.

Color reference#

Layered colors#

The foundation of rCTF’s color system is an altered version of shadcn/ui’s system. We add nested lightness layers 0 through 5, where layer l0 represents the base (page background or primary text). Higher numbers progressively add emphasis (for backgrounds) or reduce prominence (for foregrounds).

LayerBackground (light)Background (dark)Foreground (light)Foreground (dark)
l0oklch(98% 0 0)oklch(15% 0 0)neutral-700neutral-50
l1oklch(95% 0 0)oklch(18.5% 0 0)neutral-600neutral-200
l2oklch(93% 0 0)oklch(22% 0 0)neutral-500neutral-300
l3oklch(91% 0 0)oklch(26% 0 0)oklch(60% 0 0)neutral-400
l4oklch(89% 0 0)oklch(30% 0 0)oklch(65% 0 0)oklch(59.7% 0 0)
l5oklch(84% 0 0)oklch(40% 0 0)oklch(70% 0 0)neutral-500

These variables are mapped to Tailwind utilities via @theme inline in app.css, enabling classes like bg-background-l1 and text-foreground-l2 that we use throughout the application.

Semantic colors#

Semantic colors are used to convey meaning.

ColorLightDarkUsage
accentsky-200 @ 50%sky-800 @ 30%Primary actions, buttons, links
destructivered-400 @ 30%red-950 @ 50%Error states, delete actions
successemerald-500 @ 10%emerald-900 @ 10%Success states, solved challenges

Scoreboard colors#

Leaderboard colors are reserved for visualizing rankings on scoreboards and podiums, as well as for highlighting first, second, and third bloods. Gold, silver, and bronze semantically denote the top three placements (see Wikipedia’s “Hierarchy of precious substances”), while “self” highlights the current user’s row. The “nth” color is applied to all other participants outside the top three, and is just mappings of our layered color system.

ColorBackground (light)Background (dark)Foreground (light)Foreground (dark)
goldyellow-500 @ 15%yellow-950 @ 20%yellow-600yellow-400
silverslate-400 @ 20%slate-700 @ 20%slate-600slate-300
bronzeamber-800 @ 10%amber-950 @ 20%amber-800amber-500
selfoklch(93% 0.02 160)oklch(22% 0.015 163)emerald-700 @ 80%emerald-400
nthbackground-l4background-l3foreground-l1foreground-l2

Graph colors#

Graph colors are exclusively used to color lines on graphs and sparklines.

ColorLightDark
firstred-500red-300
secondamber-500amber-300
thirdlime-500lime-300
fourthemerald-500emerald-300
fifthcyan-500cyan-300
sixthsky-500sky-300
seventhblue-500blue-300
eighthviolet-500violet-300
ninthfuchsia-500fuchsia-300
tenthpink-500pink-300

Prose colors#

Prose colors are used for text in prose content, such as descriptions of challenges and homepage content.

ColorLightDark
proseforeground-l1foreground-l2
prose-linksky-700sky-300
prose-inline-codeforeground-l1red-100

Category colors#

Each challenge category is assigned an arbitrary color set from the following sets:

Colorbackground-${color}-l0background-${color}-l1foreground-${color}-l0foreground-${color}-l1
redred-400 @ 15%red-400 @ 5%red-900 @ 90%red-900 @ 80%
orangeorange-400 @ 15%orange-400 @ 5%orange-900 @ 90%orange-900 @ 80%
yellowyellow-400 @ 15%yellow-400 @ 5%yellow-900 @ 90%yellow-900 @ 80%
greengreen-400 @ 15%green-400 @ 5%green-900 @ 90%green-900 @ 80%
tealteal-400 @ 15%teal-400 @ 5%teal-900 @ 90%teal-900 @ 80%
bluesky-400 @ 15%sky-400 @ 5%sky-900 @ 90%sky-900 @ 80%
purplepurple-400 @ 15%purple-400 @ 5%purple-900 @ 90%purple-900 @ 80%
fuchsiafuchsia-400 @ 15%fuchsia-400 @ 5%fuchsia-900 @ 90%fuchsia-900 @ 80%
pinkpink-400 @ 15%pink-400 @ 5%pink-900 @ 90%pink-900 @ 80%
graygray-400 @ 15%gray-400 @ 5%gray-900 @ 90%gray-900 @ 80%
Esc

Start typing to search the docs.