RGB to LUV converter
Get the CIE 1976 Luv coordinates of an RGB color: lightness L* from 0 for black to about 100 for white, plus u* and v* measured from the D65 white. Suited to additive mixtures and chromaticity distances. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Worked example
- Resistance (Ω)
- 255
- G
- 128
- B
- 0
- L
- 67.0548169961
- U
- 106.034260378
- Voltage (V)
- 61.4652151197
- L star
- 67.0548169961
This RGB to LUV converter takes three sRGB channel intensities—red, green, and blue—each as an integer from zero through two hundred fifty-five, and returns CIE L*u*v* coordinates computed with the standard D65 white point used in web and imaging color workflows. Designers, color scientists, and developers use this mapping when a palette lives in eight-bit channels but the task needs a perceptual uniform space for distance measures, additive color models, or Luv-based analysis pipelines. The engine is fully deterministic: it inverse-compands each channel, multiplies by the D65 sRGB-to-XYZ matrix, forms CIE L* from relative luminance, then builds u* and v* from CIE u′v′ chromaticity against the D65 reference—never calling the network, sampling randomness, or depending on the clock.
How an RGB color turns into Luv values
In the eight-bit sRGB model used by CSS and most web graphics, each of red, green, and blue is an integer channel from zero through two hundred fifty-five. CIE L*u*v* rearranges that same stimulus into a lightness axis L* (roughly zero for black through about one hundred for diffuse white) and two chromatic axes u* and v* derived from the CIE 1976 u′v′ chromaticity diagram, which is often preferred when additive mixtures or uniform chromaticity distances matter more than Lab-style opponent axes.
Conversion first scales each channel by dividing by two hundred fifty-five, then undoes sRGB gamma (the IEC six-one-nine-six-six inverse companding curve) so the values become linear light. Those linear channels pass through a fixed three-by-three matrix into CIE XYZ under illuminant D65. Lightness L* is formed from relative luminance Y divided by Yn using the standard cube-root or linear CIE pivot.
Chromaticity uses u-prime equals four X over X plus fifteen Y plus three Z, and v-prime equals nine Y over the same denominator; u-star and v-star then equal thirteen times L-star times the difference from the D65 reference u-prime-n and v-prime-n. Pure black has undefined chromaticity in u′v′, so this engine sets u* and v* to zero when the XYZ sum term is zero. There is no path that accepts percentages or floating-point channels as input, and no silent clamp of two hundred fifty-six down to two hundred fifty-five.
Where RGB-to-Luv conversion fits in design, study, and software
Designers and imaging engineers meet this mapping when a brand or sensor pipeline lists RGB swatches and a workflow expects Luv targets, when chromatic distances should be reasoned about in a CIE u′v′-related space, or when a design system documents both screen RGB and Luv reference values side by side. Color scientists use L* with u* and v* when comparing additive mixtures, when preparing data for perceptual uniformity experiments, or when teaching the difference between opponent Lab axes and Luv chromaticity-derived axes.
Students see it in computer-graphics and colorimetry courses that introduce XYZ and then CIE 1976 spaces after sRGB, in digital imaging labs that move between channel sliders and perceptual coordinates, and in interview warm-ups that ask for a mental convert of a short triple. Pair it with Lab or multi-format color tools when you need other spaces, and with other free deterministic converters when you are building a small lab for color-system hygiene.
What you can do with it
Perceptual Luv tokens and distances
Turn brand RGB triples into CIE L*u*v* for perceptual distance checks, design tokens, and imaging pipelines that prefer Luv over Lab.
Homework and teaching demos
Check student sRGB-to-Luv work and live-demo XYZ and D65 Luv without opaque calculator apps.
FAQ
What does the RGB to LUV converter cost?
It is free in your browser on this page.
What range is allowed for r, g, and b?
Each channel must be an integer from 0 to 255 inclusive.
How is LUV different from LAB?
Both share the same L* lightness, but Luv builds u* and v* from CIE u′v′ chromaticity, while Lab uses opponent a* and b* axes. Choose Luv when additive mixtures or u′v′ distances matter; choose Lab for classic opponent-color workflows.
What Luv values does orange 255, 128, 0 give?
L* 67.0548169961, u* 106.034260378 and v* 61.4652151197, under the D65 white point. The lightness matches Lab, while u* and v* describe the color differently.
What happens with pure black?
Its chromaticity is undefined, so u* and v* are set to 0 as a fixed convention. You always get the same, readable result for black instead of an error.
How are u* and v* worked out?
The color is placed on the CIE 1976 u′v′ chromaticity diagram. u* and v* are its distance from the D65 white on that diagram, multiplied by thirteen times L*.
Related tools
For developers — API access
Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.
API endpoint
Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.
Call it from your stack
curl -X POST https://api.kit.forhosting.com/color/rgb-luv \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"r":255,"g":128,"b":0}'const res = await fetch("https://api.kit.forhosting.com/color/rgb-luv", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"r": 255,
"g": 128,
"b": 0
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/color/rgb-luv",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"r": 255,
"g": 128,
"b": 0
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/color/rgb-luv", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"r":255,"g":128,"b":0}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"r":255,"g":128,"b":0}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/color/rgb-luv", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"r": 255,
"g": 128,
"b": 0
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "color.rgb_luv",
"status": "queued",
"_links": {
"result": "/tasks/tsk_…/result"
}
}The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.
Pricing
Published price — no tokens, no invented credits. A failed task is never charged.
Limits
min_channel | 0 |
max_channel | 255 |
Errors
| HTTP | Code | Meaning |
|---|---|---|
401 | unauthorized | Missing or invalid API key. |
402 | insufficient_balance | Your balance doesn't cover the task price. |
404 | unknown_type | That task type doesn't exist. |
429 | rate_limited | Too many requests. Use the webhook instead of polling. |
Technical notes
Channels outside zero through two hundred fifty-five are rejected with a clear invalid_input error rather than silently clamped.
What RGB-to-Luv conversion means and what the response contains
The calculator returns the validated integers r, g, and b, rounded L and L_star for lightness, u and u_star plus v and v_star for the chromatic components, intermediate X Y Z, an rgb function string, an luv summary string, white_point set to D65, a method tag rgb_to_luv, and a short formula reminder. The engine either builds an exact Luv triple for three legal channels or rejects the request with invalid_input. Rejected cases include a missing r, g, or b field, empty strings after trimming, non-integer numbers, non-numeric text, Infinity or NaN, and any channel strictly below zero or above two hundred fifty-five.
How r, g, and b are read and how Luv stays reproducible
Outer whitespace on string channels is trimmed; an optional leading plus is allowed only when the remaining characters are decimal digits that parse to an integer in range. A bare JavaScript number is accepted only when it is a finite integer inside zero through two hundred fifty-five; values such as one hundred twenty-eight point five fail validation rather than being rounded, and negative or two-hundred-fifty-six-plus values fail with a message that names the channel and states that it must stay inside zero through two hundred fifty-five. Pure red maps to a moderate L* with large positive u* and moderate v*; pure white maps to L* near one hundred with near-zero u* and v*; pure black maps to zero on all three Luv axes. The preferred fields are r for red, g for green, and b for blue, but aliases red and capital R for red, green and capital G for green, and blue and capital B for blue are accepted so spreadsheets, query strings, and typed forms can reuse the same contract without renaming columns. After validation, conversion uses only closed-form arithmetic on the linear channels and the D65 white point, then rounds floating components to a fixed decimal width so JSON goldens and CI assertions stay stable across platforms. Pair the free browser run on this page with the priced API when you need the identical mathematical result inside an automated pipeline without re-implementing inverse gamma, XYZ projection, and CIE Luv identities yourself.
Where RGB-to-Luv conversion fits in design, study, and software
On this page the work runs entirely in your browser; through the API each successful lookup costs $0.002, failed validation is not charged, and nothing is stored after the response returns. That split—free interactive exploration and a priced, identical API—matches the rest of the KIT tier-A catalog and lets you move from a classroom demo or design review to an automated pipeline without changing the mathematical result.
Integration use cases
Deterministic test fixtures
Generate reproducible Luv results for unit tests, property checks, and CI assertions on color helpers.
Technical questions
What white point does this use?
Illuminant D65 with reference white Xn=0.95047, Yn=1.0, Zn=1.08883, matching standard sRGB and web color practice. The response includes white_point: "D65".
Why is 256 rejected instead of clamped?
Silent clamping hides data errors. Out-of-range channels fail with invalid_input so callers fix the source values instead of publishing the wrong color.