Conversion
Convert HEX to RGB
Parse a hexadecimal color and emit CSS RGB or read its integer channels.
Focused, copyable PHPColor solutions for parsing, conversion, generation, transformation, composition, evaluation, and everyday PHP tasks.
Conversion
Parse a hexadecimal color and emit CSS RGB or read its integer channels.
Conversion
Convert an RGB or hexadecimal input to device-cmyk() and CMYK channels.
Conversion
Format a hexadecimal sRGB color as CSS hsl() or read its HSL channels.
Generation
Generate random colors with controlled lightness and chroma instead of arbitrary RGB channels.
Conversion
Build a compact report that keeps delivery values, perceptual coordinates, and luminance distinct.
Generation
Derive the same readable-looking color for a username, tag, or other stable key.
Conversion
Emit a broadly supported sRGB declaration before a wider-gamut Display P3 enhancement.
Evaluation
Classify any parsed color using PHPColor's luminance-based light and dark helpers.
Generation
Derive status colors from a brand chroma and verify an accessible foreground for each role.
Parsing
Validate submitted CSS color text without exception-based control flow, then verify the accepted value survives a CSS serialization round trip.
Transformation
Create hover and pressed colors by adjusting perceptual lightness without mutating the brand color.
Parsing
Store a Display P3 color as CSS, restore it as the same concrete color type, and verify the tested channels and alpha after the round trip.
Transformation
Derive a translucent CSS token from an opaque color while preserving the tested color space and channels and leaving the source object unchanged.
Composition
Derive three colors spaced evenly around the hue wheel from one source color.
Parsing
Parse a keyed palette containing hex, OKLCH, and Display P3 colors, then emit one reparsable OKLCH representation without losing its keys.
Generation
Hold chroma and hue steady while sampling seven explicit perceptual lightness values.
Transformation
Produce light-mode candidates from an existing named dark palette without changing its keys.
Evaluation
Classify a palette by comparing its perceptual hue angles with known harmony patterns.
Composition
Pair a source color with the color opposite it on the perceptual hue wheel.
Parsing
Keep valid colors from a submitted palette while reporting each rejected entry by name.
Evaluation
Select whichever standard text color has the stronger WCAG contrast against a known background.
Conversion
Turn a named PHPColor palette into a block of hexadecimal CSS custom properties.
Composition
Generate seven evenly positioned colors between two brand endpoints in Oklab.
Transformation
Rotate every palette color by the same perceptual hue angle while retaining token names.
Evaluation
Measure the visible contrast of translucent text after it is composited onto its background.
Composition
Read perceptually mixed colors from a scale at the exact positions required by a token system.
Evaluation
Map an arbitrary color to the closest value already available in a controlled palette.
Composition
Realign an uneven three-color palette to triadic hue angles while keeping its names and perceptual character.
Evaluation
Measure the perceptual distance between an old brand color and a proposed replacement.
Evaluation
Produce a comparable palette that approximates deuteranopic color perception.
Evaluation
Calculate the lowest alpha that lets one foreground reach a required contrast ratio over one known background.
Evaluation
Test the intentional foreground and background pairs in a token system instead of producing noise from every possible combination.
Evaluation
Test the semantic color pairs that must remain distinct under every PHPColor vision simulation profile.