コンテンツへスキップ

Lesson 47: Hex colours

English

Colours as numbers

  • A web page writes a colour as six hexadecimal digits, for example #FF8000 (orange).
  • The six digits are three pairs: red, green and blue. Each pair is 00 to FF, which is 0 to 255.
  • An RGB LED has a red, a green and a blue LED inside. With analogWrite each one gets a value from 0 to 255.

Words for this lesson

Word Meaning
hexadecimal base 16: digits 0–9, then A–F for 10–15
denary base 10, our normal numbers
RGB red, green, blue
pair two hex digits: one byte, 8 bits

ログインまたはアカウント作成

IGCSE, A-Level & AP