CSS color values
A CSS hex colour code. Six hexadecimal digits (0–9 and A–F) define red, green and blue channels. Shorthand: #rgb uses one digit per channel.
What it does: 240 on the colour wheel is blue, 100% saturation is fully vivid, 50% lightness is the midpoint between black and white. CSS has 140+ named colour keywords. They are clear and readable but offer less precise control than hex, rgb(), or hsl(). Each channel in rgb(r, g, b) must be between 0 and 255. 360 is the range for the hue in hsl(), not for rgb(). 3-digit hex is shorthand for 6-digit hex. Each digit is doubled: #f00 expands to #ff0000, which is pure red. The alpha value in rgba() and hsla() controls opacity. 0 is fully transparent, 0.5 is 50% see-through, and 1 is fully opaque.
Common mistakes: #GGHHII is not valid hex. Hex colour values use only digits 0–9 and letters A–F. A valid example: #1a2b3c. The rgb() function requires commas between values: rgb(255, 0, 0), not rgb(255 0 0) without commas.
Free printable worksheet with full answer key — or add this module to a journey and assign it to your class.
Take this worksheet further — free with Cloodit
Each concept is reinforced from every angle — learned, then applied, then tested.
Cloodit turns curriculum-aligned coding content into journeys students work through one biome at a time.
Over 100 of them, across seven natural biomes.
Turns their work into revision material ready for Flash Cards and Exam study.
Live, competitive practice for the start of the lesson or a teacher-led lesson finisher.
Honour your top performers, or encourage a student who's trying hard — ready to print in seconds.
Quick Questions
Match the Pairs
Key Term
#rrggbbFill in the Blanks
Spot the Error
Create a free class, add this module to a journey, and track who's stuck.
Create a free teacher account →No credit card. No setup fee. Make a class and invite students in under three minutes.
Practice this topic interactively, track progress, and unlock badges.
Start Learning Free →