RGB Color Code

An RGB color code is a tuple containing 3 numbers representing Red, Green, and Blue color values, respectively. Ex. The color code tuple for a 24-bit color system (channel_intensity < 256) would be:

Syntax: (X, Y, Z)

Where,

  • X => Red channel intensity
  • Y => Green channel intensity
  • Z => Blue channel intensity

And the intensity of all channels should be less than 256 (for an 8-bit per channel system).

Hence for pure red color, the color code would be

(255, 0, 0)

Where

  • Red  = 255
  • Green  = 0
  • Blue = 0

Similarly, over 16 million colors could be uniquely represented. Throughout the article, the 8-bit per channel color space would be considered.

Create Random Hex Color Code Using Python

A Hexadecimal color code represents a color code in hexadecimal form. Color codes are the defacto method of representing a color. It helps accurately represent the color, regardless of the display calibration. This article will teach you how to create random hexadecimal color codes in Python

Similar Reads

RGB Color Code

An RGB color code is a tuple containing 3 numbers representing Red, Green, and Blue color values, respectively. Ex. The color code tuple for a 24-bit color system (channel_intensity < 256) would be:...

Creating Random Hex Color Codes in Python

Generating a Color code in decimal and then converting it into a Hexadecimal base is the method for achieving the desired result. The process is trivial and could be accomplished easily by using a random value generator such as randint....