Developer Tools

Color Picker

Live

Calculate hex from color value, comparison color.

About Color Picker

Calculate hex from color value, comparison color. Enter color value, comparison color in a purpose-built color picker interface designed for this subject. The entered CSS hex or RGB color is normalized, converted to HSL, and compared using relative luminance. The result includes hex, rgb, hsl, contrast ratio, contrast guidance, supporting detail, and clear units or diagnostics. Results depend on the entered assumptions, units, supported input range, and rounding. Review important decisions against authoritative requirements. Processing stays in your browser, and UtilityPages does not store the values you enter.

Set up Color Picker

Workspace

Source workbench

Edit the source fields below and inspect the rendered output alongside your work.

This workspace updates as you edit.

Enter color value.

Enter comparison color.

Color Picker result

Enter the values above, then process to see a detailed result.

How Color Picker works

The entered CSS hex or RGB color is normalized, converted to HSL, and compared using relative luminance.

How it works

The entered CSS hex or RGB color is normalized, converted to HSL, and compared using relative luminance. Results depend on the entered assumptions, units, supported input range, and rounding. Review important decisions against authoritative requirements.

Examples

Color Picker worked example

Example input
{
    "color": "#2563eb",
    "comparison": "#ffffff"
}
Expected result
{
    "hex": "#2563EB",
    "rgb": "rgb(37, 99, 235)",
    "hsl": "hsl(221.212121 83.193277% 53.333333%)",
    "contrast_ratio": 5.17,
    "wcag_result": "AA normal text"
}

Privacy

This tool does not store your inputs or results on UtilityPages.org.

Citations & sources

  1. Web APIs

Frequently asked questions

How does the Color Picker work?

The entered CSS hex or RGB color is normalized, converted to HSL, and compared using relative luminance.

What information should I enter?

Enter color value, comparison color. Use values and units from the same scenario so the result is internally consistent.

What results does this tool provide?

It reports hex, rgb, hsl, contrast ratio, contrast guidance, including intermediate context where it helps you review the answer.

What limitations should I know about?

Results depend on the entered assumptions, units, supported input range, and rounding. Review important decisions against authoritative requirements.