
- Computer Graphics - Home
- Computer Graphics Basics
- Computer Graphics Applications
- Graphics APIs and Pipelines
- Computer Graphics Maths
- Sets and Mapping
- Solving Quadratic Equations
- Computer Graphics Trigonometry
- Computer Graphics Vectors
- Linear Interpolation
- Computer Graphics Devices
- Cathode Ray Tube
- Raster Scan Display
- Random Scan Device
- Phosphorescence Color CRT
- Flat Panel Displays
- 3D Viewing Devices
- Images Pixels and Geometry
- Color Models
- Line Generation
- Line Generation Algorithm
- DDA Algorithm
- Bresenham's Line Generation Algorithm
- Mid-point Line Generation Algorithm
- Circle Generation
- Circle Generation Algorithm
- Bresenham's Circle Generation Algorithm
- Mid-point Circle Generation Algorithm
- Ellipse Generation Algorithm
- Polygon Filling
- Polygon Filling Algorithm
- Scan Line Algorithm
- Flood Filling Algorithm
- Boundary Fill Algorithm
- 4 and 8 Connected Polygon
- Inside Outside Test
- 2D Transformation
- 2D Transformation
- Transformation Between Coordinate System
- Affine Transformation
- Raster Methods Transformation
- 2D Viewing
- Viewing Pipeline and Reference Frame
- Window Viewport Coordinate Transformation
- Viewing & Clipping
- Point Clipping Algorithm
- Cohen-Sutherland Line Clipping
- Cyrus-Beck Line Clipping Algorithm
- Polygon Clipping Sutherland–Hodgman Algorithm
- Text Clipping
- Clipping Techniques
- Bitmap Graphics
- 3D Viewing Transformation
- 3D Computer Graphics
- Parallel Projection
- Orthographic Projection
- Oblique Projection
- Perspective Projection
- 3D Transformation
- Rotation with Quaternions
- Modelling and Coordinate Systems
- Back-face Culling
- Lighting in 3D Graphics
- Shadowing in 3D Graphics
- 3D Object Representation
- Represnting Polygons
- Computer Graphics Surfaces
- Visible Surface Detection
- 3D Objects Representation
- Computer Graphics Curves
- Computer Graphics Curves
- Types of Curves
- Bezier Curves and Surfaces
- B-Spline Curves and Surfaces
- Data Structures For Graphics
- Triangle Meshes
- Scene Graphs
- Spatial Data Structure
- Binary Space Partitioning
- Tiling Multidimensional Arrays
- Color Theory
- Colorimetry
- Chromatic Adaptation
- Color Appearance
- Antialiasing
- Ray Tracing
- Ray Tracing Algorithm
- Perspective Ray Tracing
- Computing Viewing Rays
- Ray-Object Intersection
- Shading in Ray Tracing
- Transparency and Refraction
- Constructive Solid Geometry
- Texture Mapping
- Texture Values
- Texture Coordinate Function
- Antialiasing Texture Lookups
- Procedural 3D Textures
- Reflection Models
- Real-World Materials
- Implementing Reflection Models
- Specular Reflection Models
- Smooth-Layered Model
- Rough-Layered Model
- Surface Shading
- Diffuse Shading
- Phong Shading
- Artistic Shading
- Computer Animation
- Computer Animation
- Keyframe Animation
- Morphing Animation
- Motion Path Animation
- Deformation Animation
- Character Animation
- Physics-Based Animation
- Procedural Animation Techniques
- Computer Graphics Fractals
Color Models in Computer Graphics
In graphics, we generate color images there are multiple such modes available. Read this chapter to learn the various color models used in computer graphics. We will cover the basics and provide examples to help you understand these concepts better.
Key Characteristics of Color Models
Color is how we perceive light reflected from objects. Our eyes detect color in the visible range of the electromagnetic spectrum. This range is in between 390 to 700 nanometers (nm).
Color has three main characteristics −
- Hue − This is the dominant wavelength of light we perceive. It is what we typically mean when we name a color like "red" or "blue".
- Saturation − This refers to the purity of the color. A highly saturated color is vivid, while a less saturated color appears more muted.
- Luminance − This is the lightness or intensity of the color. It determines how bright or dark a color appears.

Hue and saturation together are called the chroma components of color. Luminance is referred to as the luma component.
Color Models in Computer Graphics
Color models use primary colors to produce a wide range of other colors. The range of colors a model can produce is called its color gamut. Let us explore some popular color models used in computer graphics.
RGB Color Model
The RGB color model is the most widely used in computer graphics. It uses three primary colors: Red, Green, and Blue. Let us see some of the key features of the RGB model. It is represented by a unit cube:
- Values for R, G, and B range from 0 to 1
- Black is at the origin (0,0,0) and White is at (1,1,1)
- The diagonal line from Black to White is called the Gray Line

Examples in the RGB model:
- Pure Red: (1,0,0)
- Pure Green: (0,1,0)
- Pure Blue: (0,0,1)
- Yellow: (1,1,0)
- Magenta: (1,0,1)
- Cyan: (0,1,1)
The RGB model is used in display devices like computer monitors and TVs. It uses additive color mixing to produce colors. This means it starts with black and adds light to create other colors.
CMY Color Model
The CMY model uses Cyan, Magenta, and Yellow as its primary colors. It's also represented by a unit cube:
- White is at the origin (0,0,0) and Black is at (1,1,1)
- It uses subtractive color mixing
Examples in the CMY model −
- Pure Cyan: (1,0,0)
- Pure Magenta: (0,1,0)
- Pure Yellow: (0,0,1)
- Red: (0,1,1)
- Green: (1,0,1)
- Blue: (1,1,0)
The CMY model is primarily used in printing. It is often extended to CMYK, where K stands for Black. This is because combining pure cyan, magenta, and yellow does not produce a true black in practice.
YUV/YIQ/YCbCr Color Model
This family of color models separates luminance (brightness) from chrominance (color information). The key features are −
- Y represents luminance
- U and V (or I and Q) represent color information
It is widely used in television broadcasting and video compression
Example of RGB to YIQ conversion −
- Y = 0.299R + 0.587G + 0.114B
- I = 0.596R - 0.275G - 0.321B
- Q = 0.212R - 0.523G + 0.311B
This model is efficient for transmission because it separates the brightness signal (Y) from the color information.
HSV Color Model
The HSV model represents colors using Hue, Saturation, and Value. The key features of the HSV model is it is represented by a hexagonal cone as shown in the above figure.
- Hue is measured as an angle (0-360°)
- Saturation and Value range from 0 to 1
It's useful for intuitive color selection
Examples in the HSV model −
- Red: H = 0°, S = 1, V = 1
- Green: H = 120°, S = 1, V = 1
- Blue: H = 240°, S = 1, V = 1
- Yellow: H = 60°, S = 1, V = 1
HLS Color Model
The HLS model is similar to HSV but uses Lightness instead of Value. The key features of the HLS model:
- It's represented by a double hexagonal cone
- Hue is measured as an angle (0-360°)
- Saturation and Lightness range from 0 to 1
- Pure colors are at L = 0.5
Examples in the HLS model −
- Red: H = 0°, S = 1, L = 0.5
- Green: H = 120°, S = 1, L = 0.5
- Blue: H = 240°, S = 1, L = 0.5
- White: H = any, S = 0, L = 1
- Black: H = any, S = 0, L = 0
The HLS model is also used in color selection interfaces and image processing tasks.
Example of Converting between Color Models
Converting between color models is often necessary in graphics applications. Here is a simple example of converting from RGB to HSV.
Find the maximum (max) and minimum (min) of R, G, and B −
- V = max
- S = (max - min) / max (if max is not zero)
- H is calculated based on which color is max −
- If R is max: H = (G - B) / (max - min)
- If G is max: H = 2 + (B - R) / (max - min)
- If B is max: H = 4 + (R - G) / (max - min)
- Multiply H by 60 to convert to degrees
- Applications of Color Models
Different color models are used for various applications in computer graphics −
- RGB − Used in display devices like monitors, TVs, and digital cameras
- CMY/CMYK − Used in printing and publishing
- YUV/YIQ − Used in television broadcasting and video compression
- HSV/HLS − Used in color selection interfaces and image processing tasks
Conclusion
In this chapter, we covered the basic concepts of color models in computer graphics. We explained the basics of color perception and examined various color models including RGB, CMY, YUV, HSV, and HLS. Finally, we explained how to convert between different color models and their applications in different areas of computer graphics.