Implementation:SeleniumHQ Selenium Closure Color
| Knowledge Sources | |
|---|---|
| Domains | JavaScript_Atoms, Vendored_Library |
| Last Updated | 2026-02-12 00:00 GMT |
Overview
Vendored Google Closure Library module providing color parsing and conversion utilities used by Selenium JavaScript atoms.
Description
goog.color is a vendored copy of the Google Closure Library module. It provides utilities related to color and color conversion, supporting RGB, HSL, HSV, and hex color representations. Functions include parsing color strings, converting between formats (hex, RGB, HSL, HSV), color blending, lightening, darkening, and high-contrast color selection. Selenium uses this as part of its JavaScript atom infrastructure for browser automation commands.
Usage
This module is consumed internally by Selenium's JavaScript atoms build system. It is not imported directly by end users.
Code Reference
Source Location
- Repository: SeleniumHQ_Selenium
- File: third_party/closure/goog/color/color.js
- Lines: 1-784
Key Exports
goog.provide('goog.color');
goog.provide('goog.color.Hsl');
goog.provide('goog.color.Hsv');
goog.provide('goog.color.Rgb');
// Key exported functions:
goog.color.parse(str)
goog.color.isValidColor(str)
goog.color.hexToRgb(hexColor)
goog.color.rgbToHex(r, g, b)
goog.color.rgbToHsl(r, g, b)
goog.color.hslToRgb(h, s, l)
goog.color.hsvToRgb(h, s, brightness)
goog.color.rgbToHsv(red, green, blue)
goog.color.normalizeHex(hexColor)
goog.color.blend(rgb1, rgb2, factor)
goog.color.darken(rgb, factor)
goog.color.lighten(rgb, factor)
goog.color.highContrast(prime, suggestions)