A comprehensive guide to the spectral locus - the curved boundary on the CIE chromaticity diagram that represents all monochromatic (single-wavelength) colors visible to the human eye, forming the foundation for colorimetric calculations and color space definitions.
The spectral locus is the curved boundary on the CIE chromaticity diagram that represents all monochromatic (single-wavelength) colors visible to the human eye, spanning wavelengths from approximately 380nm (violet) to 780nm (red). This fundamental curve serves as the foundation for colorimetric calculations, defining the limits of human color perception and providing the reference for color purity measurements, dominant wavelength calculations, and color gamut definitions. Understanding the spectral locus is essential for color science applications, display technology, lighting design, and any field requiring precise color specification and analysis.
The spectral locus represents the chromaticity coordinates of monochromatic light at each wavelength, derived from the CIE color matching functions and standard observer data.
// Spectral Locus Analysis System
class SpectralLocusSystem {
constructor() {
// System definition and parameters
this.systemDefinition = {
concept: 'Boundary of monochromatic colors on chromaticity diagram',
wavelength_range: { min: 380, max: 780, unit: 'nanometers' },
coordinate_system: 'CIE 1931 xy chromaticity',
mathematical_basis: 'CIE color matching functions',
applications: [
'Color gamut definition',
'Dominant wavelength calculation',
'Excitation purity measurement',
'Color space boundaries',
'Display characterization'
]
};
// Wavelength to color name mapping
this.wavelengthColors = {
380: { name: 'Violet', hex: '#8B00FF', description: 'Deep violet' },
400: { name: 'Violet', hex: '#4B0082', description: 'Violet-blue' },
420: { name: 'Blue', hex: '#0000FF', description: 'Deep blue' },
440: { name: 'Blue', hex: '#0080FF', description: 'Blue' },
460: { name: 'Blue', hex: '#00BFFF', description: 'Light blue' },
480: { name: 'Cyan', hex: '#00FFFF', description: 'Cyan-blue' },
500: { name: 'Cyan', hex: '#00FF80', description: 'Blue-green' },
520: { name: 'Green', hex: '#00FF00', description: 'Green' },
540: { name: 'Green', hex: '#80FF00', description: 'Yellow-green' },
560: { name: 'Yellow', hex: '#FFFF00', description: 'Green-yellow' },
580: { name: 'Yellow', hex: '#FFD700', description: 'Yellow' },
600: { name: 'Orange', hex: '#FFA500', description: 'Yellow-orange' },
620: { name: 'Orange', hex: '#FF4500', description: 'Orange' },
640: { name: 'Red', hex: '#FF0000', description: 'Orange-red' },
660: { name: 'Red', hex: '#DC143C', description: 'Red' },
680: { name: 'Red', hex: '#B22222', description: 'Deep red' },
700: { name: 'Red', hex: '#8B0000', description: 'Dark red' },
780: { name: 'Red', hex: '#4B0000', description: 'Far red' }
};
// Generate detailed spectral locus data
this.spectralLocusData = this.generateSpectralLocusData();
// Color matching functions (CIE 1931 2° standard observer)
this.colorMatchingFunctions = this.generateColorMatchingFunctions();
// Analysis parameters
this.analysisParameters = {
interpolation_step: 1, // nm
precision_digits: 6,
calculation_method: 'tristimulus_integration',
normalization: 'Y_equals_100'
};
}
// Generate spectral locus chromaticity coordinates
generateSpectralLocusData() {
const spectralData = {};
// Generate coordinates for each wavelength
for (let wavelength = 380; wavelength <= 780; wavelength += 1) {
const coordinates = this.calculateChromaticityFromWavelength(wavelength);
spectralData[wavelength] = {
wavelength: wavelength,
chromaticity: coordinates,
color_name: this.getColorName(wavelength),
approximate_rgb: this.wavelengthToRGB(wavelength),
energy_level: this.calculateRelativeEnergy(wavelength),
visibility_factor: this.calculateVisibilityFactor(wavelength)
};
}
return spectralData;
}
// Calculate chromaticity coordinates from wavelength
calculateChromaticityFromWavelength(wavelength) {
// Simplified calculation based on CIE color matching functions
// In practice, this would use actual CIE data tables
let x, y;
if (wavelength < 380 || wavelength > 780) {
return { x: 0, y: 0, valid: false };
}
// Approximate spectral locus using mathematical model
if (wavelength <= 440) {
// Violet to blue region
const t = (wavelength - 380) / (440 - 380);
x = 0.15 + 0.02 * t;
y = 0.02 + 0.04 * t;
} else if (wavelength <= 490) {
// Blue to cyan region
const t = (wavelength - 440) / (490 - 440);
x = 0.17 - 0.02 * t;
y = 0.06 + 0.24 * t;
} else if (wavelength <= 520) {
// Cyan to green region
const t = (wavelength - 490) / (520 - 490);
x = 0.15 + 0.15 * t;
y = 0.30 + 0.30 * t;
} else if (wavelength <= 580) {
// Green to yellow region
const t = (wavelength - 520) / (580 - 520);
x = 0.30 + 0.14 * t;
y = 0.60 - 0.15 * t;
} else if (wavelength <= 650) {
// Yellow to red region
const t = (wavelength - 580) / (650 - 580);
x = 0.44 + 0.20 * t;
y = 0.45 - 0.12 * t;
} else {
// Deep red region
const t = (wavelength - 650) / (780 - 650);
x = 0.64 + 0.10 * t;
y = 0.33 - 0.05 * t;
}
return { x: x, y: y, valid: true };
}
// Find closest wavelength to chromaticity coordinates
findClosestWavelength(chromaticity, tolerance = 0.01) {
const analysis = {
input_chromaticity: chromaticity,
closest_wavelength: null,
distance: Infinity,
tolerance: tolerance,
is_on_locus: false,
interpolated_wavelength: null,
analysis_method: 'minimum_distance'
};
let minDistance = Infinity;
let closestWavelength = null;
// Check each wavelength point
for (let wavelength = 380; wavelength <= 780; wavelength += 1) {
const spectralPoint = this.spectralLocusData[wavelength].chromaticity;
if (spectralPoint.valid) {
const distance = Math.sqrt(
Math.pow(chromaticity.x - spectralPoint.x, 2) +
Math.pow(chromaticity.y - spectralPoint.y, 2)
);
if (distance < minDistance) {
minDistance = distance;
closestWavelength = wavelength;
}
}
}
analysis.closest_wavelength = closestWavelength;
analysis.distance = minDistance;
analysis.is_on_locus = minDistance <= tolerance;
// Perform interpolation for more precise wavelength
if (closestWavelength !== null) {
analysis.interpolated_wavelength = this.interpolateWavelength(
chromaticity,
closestWavelength
);
}
return analysis;
}
// Calculate gamut area enclosed by spectral locus
calculateGamutArea(colorSpace = 'sRGB') {
const gamutAnalysis = {
color_space: colorSpace,
spectral_locus_area: 0,
gamut_area: 0,
coverage_percentage: 0,
gamut_vertices: [],
calculation_method: 'polygon_area'
};
// Calculate spectral locus area using shoelace formula
const spectralPoints = [];
for (let wavelength = 380; wavelength <= 780; wavelength += 5) {
const point = this.spectralLocusData[wavelength].chromaticity;
if (point.valid) {
spectralPoints.push([point.x, point.y]);
}
}
// Add purple line to close the shape
const purpleLine = this.calculatePurpleLine();
spectralPoints.push(...purpleLine);
gamutAnalysis.spectral_locus_area = this.calculatePolygonArea(spectralPoints);
// Calculate specific color space gamut
const gamutVertices = this.getColorSpaceVertices(colorSpace);
gamutAnalysis.gamut_vertices = gamutVertices;
gamutAnalysis.gamut_area = this.calculatePolygonArea(gamutVertices);
// Calculate coverage percentage
gamutAnalysis.coverage_percentage =
(gamutAnalysis.gamut_area / gamutAnalysis.spectral_locus_area) * 100;
return gamutAnalysis;
}
// Analyze color gamut coverage
analyzeGamutCoverage(displayGamut, referenceGamut = 'spectral_locus') {
const coverage = {
display_gamut: displayGamut,
reference_gamut: referenceGamut,
coverage_analysis: {},
wavelength_coverage: {},
missing_regions: [],
recommendations: []
};
// Analyze coverage by wavelength regions
const regions = {
'violet': { range: [380, 420], coverage: 0 },
'blue': { range: [420, 490], coverage: 0 },
'cyan': { range: [490, 510], coverage: 0 },
'green': { range: [510, 560], coverage: 0 },
'yellow': { range: [560, 590], coverage: 0 },
'orange': { range: [590, 620], coverage: 0 },
'red': { range: [620, 780], coverage: 0 }
};
// Calculate coverage for each region
for (const [regionName, regionData] of Object.entries(regions)) {
const regionCoverage = this.calculateRegionCoverage(
displayGamut,
regionData.range[0],
regionData.range[1]
);
regions[regionName].coverage = regionCoverage.percentage;
regions[regionName].details = regionCoverage;
if (regionCoverage.percentage < 80) {
coverage.missing_regions.push({
region: regionName,
coverage: regionCoverage.percentage,
impact: this.assessRegionImpact(regionName, regionCoverage.percentage)
});
}
}
coverage.wavelength_coverage = regions;
// Overall coverage assessment
const totalCoverage = Object.values(regions)
.reduce((sum, region) => sum + region.coverage, 0) / Object.keys(regions).length;
coverage.coverage_analysis = {
overall_coverage: totalCoverage,
quality_level: this.determineQualityLevel(totalCoverage),
strong_regions: Object.entries(regions)
.filter(([name, data]) => data.coverage > 90)
.map(([name]) => name),
weak_regions: Object.entries(regions)
.filter(([name, data]) => data.coverage < 70)
.map(([name]) => name)
};
// Generate recommendations
coverage.recommendations = this.generateGamutRecommendations(
coverage.coverage_analysis,
coverage.missing_regions
);
return coverage;
}
// Visualize spectral locus with annotations
generateVisualizationData(includeGamuts = ['sRGB', 'Adobe RGB', 'P3']) {
const visualization = {
spectral_locus_points: [],
purple_line_points: [],
wavelength_annotations: [],
gamut_overlays: [],
coordinate_grid: [],
rendering_instructions: {}
};
// Generate spectral locus points
for (let wavelength = 380; wavelength <= 780; wavelength += 1) {
const data = this.spectralLocusData[wavelength];
if (data.chromaticity.valid) {
visualization.spectral_locus_points.push({
x: data.chromaticity.x,
y: data.chromaticity.y,
wavelength: wavelength,
color: data.approximate_rgb,
label: wavelength % 20 === 0 ? `${wavelength}nm` : null
});
}
}
// Generate purple line
visualization.purple_line_points = this.calculatePurpleLine();
// Add wavelength annotations
const annotationWavelengths = [400, 450, 500, 550, 600, 650, 700];
annotationWavelengths.forEach(wavelength => {
const data = this.spectralLocusData[wavelength];
if (data) {
visualization.wavelength_annotations.push({
x: data.chromaticity.x,
y: data.chromaticity.y,
wavelength: wavelength,
color_name: data.color_name,
label: `${wavelength}nm\n${data.color_name}`
});
}
});
// Add gamut overlays
includeGamuts.forEach(gamutName => {
const vertices = this.getColorSpaceVertices(gamutName);
visualization.gamut_overlays.push({
name: gamutName,
vertices: vertices,
style: this.getGamutStyle(gamutName)
});
});
// Generate coordinate grid
visualization.coordinate_grid = this.generateCoordinateGrid();
// Rendering instructions
visualization.rendering_instructions = {
canvas_size: { width: 800, height: 600 },
coordinate_range: { x: [0, 0.8], y: [0, 0.9] },
background_color: '#ffffff',
grid_color: '#e0e0e0',
locus_line_width: 3,
gamut_line_width: 2,
annotation_font: '12px Arial',
title: 'CIE 1931 Chromaticity Diagram with Spectral Locus'
};
return visualization;
}
// Calculate dominant wavelength using spectral locus
calculateDominantWavelength(chromaticity, whitePoint = { x: 0.31271, y: 0.32902 }) {
const analysis = {
input_chromaticity: chromaticity,
white_point: whitePoint,
dominant_wavelength: null,
excitation_purity: 0,
color_type: null,
intersection_point: null,
calculation_method: 'line_intersection_with_locus'
};
// Calculate line from white point through color point
const dx = chromaticity.x - whitePoint.x;
const dy = chromaticity.y - whitePoint.y;
if (Math.abs(dx) < 0.0001 && Math.abs(dy) < 0.0001) {
analysis.color_type = 'achromatic';
return analysis;
}
// Find intersection with spectral locus
const intersection = this.findLineLocusIntersection(whitePoint, chromaticity);
if (intersection.found) {
analysis.dominant_wavelength = intersection.wavelength;
analysis.intersection_point = intersection.point;
analysis.color_type = intersection.type;
// Calculate excitation purity
const colorDistance = Math.sqrt(dx * dx + dy * dy);
const locusDistance = Math.sqrt(
Math.pow(intersection.point.x - whitePoint.x, 2) +
Math.pow(intersection.point.y - whitePoint.y, 2)
);
analysis.excitation_purity = (colorDistance / locusDistance) * 100;
} else {
analysis.color_type = 'purple';
// Handle purple line colors (complementary wavelength)
const complementary = this.findComplementaryWavelength(whitePoint, chromaticity);
analysis.complementary_wavelength = complementary.wavelength;
analysis.excitation_purity = complementary.purity;
}
return analysis;
}
// Generate color matching functions data
generateColorMatchingFunctions() {
const cmf = {
wavelengths: [],
x_bar: [],
y_bar: [],
z_bar: [],
description: 'CIE 1931 2° Standard Observer Color Matching Functions'
};
// Simplified approximation of CIE color matching functions
for (let wavelength = 380; wavelength <= 780; wavelength += 5) {
cmf.wavelengths.push(wavelength);
// Approximate x̄(λ) function
let x_bar = 0;
if (wavelength >= 400 && wavelength <= 700) {
const t = (wavelength - 400) / 300;
x_bar = Math.exp(-0.5 * Math.pow((t - 0.17) / 0.15, 2)) * 1.056 +
Math.exp(-0.5 * Math.pow((t - 0.8) / 0.2, 2)) * 0.362;
}
// Approximate ȳ(λ) function (photopic luminosity)
let y_bar = 0;
if (wavelength >= 400 && wavelength <= 700) {
const t = (wavelength - 400) / 300;
y_bar = Math.exp(-0.5 * Math.pow((t - 0.5) / 0.16, 2));
}
// Approximate z̄(λ) function
let z_bar = 0;
if (wavelength >= 400 && wavelength <= 500) {
const t = (wavelength - 400) / 100;
z_bar = Math.exp(-0.5 * Math.pow((t - 0.2) / 0.15, 2)) * 2.0;
}
cmf.x_bar.push(x_bar);
cmf.y_bar.push(y_bar);
cmf.z_bar.push(z_bar);
}
return cmf;
}
}The spectral locus is derived from the CIE 1931 color matching functions (x̄(λ), ȳ(λ), z̄(λ)) which represent the spectral sensitivity of the human visual system.
Each point on the spectral locus represents the chromaticity coordinates (x, y) of monochromatic light at a specific wavelength, calculated from tristimulus values.
The visible spectrum spans approximately 380nm to 780nm, with the spectral locus forming a horseshoe-shaped curve on the chromaticity diagram.
The shortest visible wavelengths produce deep violet and purple colors, forming the bottom-left portion of the spectral locus.
Blue wavelengths create the left side of the spectral locus, transitioning from deep blue to cyan-blue.
Green wavelengths form the top portion of the locus, including cyan, green, and yellow-green colors.
Longer wavelengths create the right side of the locus, spanning yellow, orange, and red colors.
The spectral locus serves as the reference for calculating dominant wavelength by finding the intersection of a line from the white point through the color point.
Color purity is determined by measuring the relative distance from the white point to the color point versus the distance to the spectral locus.
Display and print color gamuts are defined relative to the spectral locus, showing the range of colors that can be reproduced.
Display technologies are characterized by how much of the spectral locus they can reproduce, with wider gamuts covering more of the visible spectrum.
RGB primaries are chosen to maximize gamut coverage while maintaining practical implementation constraints.
Standard color spaces like sRGB, Adobe RGB, and P3 are defined by their triangular gamuts within the spectral locus boundary.
The spectral locus provides the fundamental reference for all colorimetric measurements and color quality assessments.
Monitor calibration processes use the spectral locus to verify color accuracy and gamut coverage.
Industrial color matching relies on spectral locus relationships to ensure consistent color reproduction.
The purple line connects the violet and red endpoints of the spectral locus, representing colors that cannot be produced by single wavelengths.
Colors on the purple line are characterized by complementary wavelengths rather than dominant wavelengths.
The purple line completes the boundary of all possible chromaticity coordinates, forming a closed shape with the spectral locus.
Advanced display technologies use spectral locus analysis to achieve wider color gamuts and improved color reproduction.
LED lighting design uses spectral locus principles to create desired color temperatures and color rendering properties.
Digital color management relies on spectral locus relationships for accurate color space conversions and gamut mapping.
Different standard observers (2° vs 10°) produce slightly different spectral locus shapes, affecting colorimetric calculations.
While the spectral locus itself is illuminant-independent, its applications in color measurement depend on the chosen reference illuminant.
High-precision applications require accurate spectral locus data and careful interpolation between measured wavelength points.
Explore these comprehensive pillar articles related to Spectral Locus
A comprehensive guide to color theory, its fundamental principles, and practical applications in digital design and web development.
A comprehensive guide to monochromatic color schemes - sophisticated single-hue harmonies that create unified visual experiences through systematic variations in saturation, lightness, and tonal relationships, essential for elegant design compositions, brand consistency, and advanced color theory applications requiring cohesive aesthetic unity.
Comprehensive guide to complementary colors - opposing hues on the color wheel that create maximum visual contrast, dynamic tension, and powerful design impact through scientific color relationships and perceptual phenomena.
Comprehensive guide to analogous color schemes - adjacent hues on the color wheel that create natural harmony, visual cohesion, and sophisticated design solutions through subtle color relationships and graduated transitions.
Discover more about Spectral Locus and related color theory concepts
A comprehensive guide to color theory, its fundamental principles, and practical applications in digital design and web development.
A comprehensive guide to monochromatic color schemes - sophisticated single-hue harmonies that create unified visual experiences through systematic variations in saturation, lightness, and tonal relationships, essential for elegant design compositions, brand consistency, and advanced color theory applications requiring cohesive aesthetic unity.
Comprehensive guide to analogous color schemes - adjacent hues on the color wheel that create natural harmony, visual cohesion, and sophisticated design solutions through subtle color relationships and graduated transitions.
Comprehensive guide to complementary colors - opposing hues on the color wheel that create maximum visual contrast, dynamic tension, and powerful design impact through scientific color relationships and perceptual phenomena.
A comprehensive guide to split-complementary color schemes - sophisticated three-color harmonies that combine a base color with two colors adjacent to its complement, creating balanced visual contrast with reduced tension compared to direct complementary pairs, essential for refined design compositions, brand identity systems, and advanced color theory applications.
A comprehensive guide to tetradic color schemes - sophisticated four-color harmonies that use two complementary pairs arranged in rectangular or square formations on the color wheel, providing maximum color variety while maintaining structured relationships essential for dynamic design compositions, brand systems, and advanced color theory applications.
Discover more color terminology and concepts in our comprehensive glossary.
Browse Full Glossary