CSS named colour
Blue
#0000ff
A CSS named colour: blue is valid anywhere a colour is expected.
- RGB
- rgb(0 0 255)
- HSL
- 240°, 100%, 50%
- OKLCh
- 45.2% 0.313 264.1
Blue in every format
Web & CSSThe everyday formats for stylesheets and design tools.
| Hex | #0000ff | |
|---|---|---|
| RGB | rgb(0 0 255) | |
| RGB legacy | rgb(0, 0, 255) | |
| RGB percent | rgb(0% 0% 100%) | |
| HSL | hsl(240 100% 50%) | |
| HSL legacy | hsl(240, 100%, 50%) | |
| HSV / HSB | hsv(240, 100%, 100%) | |
| HWB | hwb(240 0% 0%) | |
| Nearest name | blue | |
| CMYK | cmyk(100%, 100%, 0%, 0%)Naive conversion. Real print work needs an ICC profile. |
Perceptual & wide gamutModern CSS colour spaces for uniform scales and P3 displays.
| OKLCh | oklch(45.201% 0.31321 264.052)Modern CSS colour space for even palettes — better than HSL when building scales. | |
|---|---|---|
| OKLab | oklab(45.201% -0.03246 -0.31153) | |
| CIE LCh | lch(29.568% 131.201 301.364) | |
| CIE Lab | lab(29.568% 68.287 -112.03) | |
| Display P3 | color(display-p3 0 0 0.9596) | |
| Rec. 2020 | color(rec2020 0.1684 0.0511 0.9468) | |
| srgb-linear | color(srgb-linear 0 0 1)Light-linear sRGB — the same numbers a shader wants for maths. | |
| CIE XYZ (D65) | color(xyz-d65 0.1805 0.0722 0.9505) |
ShadersGLSL, HLSL and WGSL vectors in both encoded and linear form.
| GLSL vec3 — sRGB | vec3(0.0, 0.0, 1.0)Encoded values. Use when writing straight to the framebuffer. | |
|---|---|---|
| GLSL vec3 — linear | vec3(0.0, 0.0, 1.0)Light-linear values. Use for lighting, blending and mixing. | |
| GLSL vec4 — sRGB | vec4(0.0, 0.0, 1.0, 1.0) | |
| GLSL vec4 — linear | vec4(0.0, 0.0, 1.0, 1.0) | |
| GLSL ivec3 | ivec3(0, 0, 255) | |
| HLSL float3 — sRGB | float3(0.0, 0.0, 1.0) | |
| HLSL float3 — linear | float3(0.0, 0.0, 1.0) | |
| HLSL float4 — sRGB | float4(0.0, 0.0, 1.0, 1.0) | |
| HLSL half4 — sRGB | half4(0.0, 0.0, 1.0, 1.0) | |
| WGSL vec3f — sRGB | vec3f(0.0, 0.0, 1.0) | |
| WGSL vec4f — sRGB | vec4f(0.0, 0.0, 1.0, 1.0) | |
| WGSL vec3<f32> — linear | vec3<f32>(0.0, 0.0, 1.0) |
Engines & appsConstructors for Unity, Unreal, Godot, Flutter, SwiftUI and Android.
| Unity Color | new Color(0.0f, 0.0f, 1.0f, 1.0f)Color for everyday scripting (0–1). Color32 when you need whole numbers from 0 to 255. | |
|---|---|---|
| Unity Color32 | new Color32(0, 0, 255, 255) | |
| Unreal FLinearColor | FLinearColor(0.0f, 0.0f, 1.0f, 1.0f)FLinearColor for materials and lighting. FColor when you need whole numbers from 0 to 255. | |
| Unreal FColor | FColor(0, 0, 255, 255)Whole numbers from 0 to 255 — use when an API asks for FColor, not FLinearColor. | |
| Godot Color | Color(0, 0, 1, 1) | |
| Flutter Color | Color(0xFF0000FF)Packed ARGB, so alpha comes first. | |
| Android Color | Color.rgb(0, 0, 255) | |
| SwiftUI Color | Color(red: 0, green: 0, blue: 1) | |
| UIKit UIColor | UIColor(red: 0, green: 0, blue: 1, alpha: 1) |
Raw valuesPacked integers and plain arrays.
| 0x hex | 0x0000FF | |
|---|---|---|
| 0x hex (ARGB) | 0xFF0000FF | |
| Array 0–1 | [0, 0, 1] | |
| Array 0–255 | [0, 0, 255] | |
| Decimal integer | 255 |
Contrast and accessibility
WCAG 2 ratios are what audits and legislation reference. APCA is shown alongside because WCAG 2 is known to misjudge mid-tone backgrounds, and it is the basis of the WCAG 3 draft.
| Pairing | WCAG 2 ratio | Level | APCA | Suitable for |
|---|---|---|---|---|
| Blue on white | 8.59:1 | AAA | Lc 86 | Body text, 18px and up |
| Blue on black | 2.44:1 | Fail | Lc 16 | Not usable for text |
Blue text on a white background
Blue text on a black background
White text on Blue
Black text on Blue
Tonal scale
Hue held fixed while lightness walks OKLCh, ready to use as a design system ramp.
- 50#edf8ff
- 100#deeeff
- 200#c4ddff
- 300#a2c5ff
- 400#75a5ff
- 500#447fff
- 600#1656ff
- 700#002ef8
- 800#000fd4
- 900#0200b5
- 950#020076
Tints and shades
Mixed perceptually toward white and black, so the steps feel evenly spaced.
- Tint 1#1957ff
- Tint 2#4780ff
- Tint 3#74a3ff
- Tint 4#a1c3ff
- Tint 5#cfe1ff
- Shade 1#0000c8
- Shade 2#000094
- Shade 3#000063
- Shade 4#000036
- Shade 5#00000f
Colours that work with Blue
Complementary, triadic and analogous partners, rotated in OKLCh so they keep the same apparent brightness.
- #734f00
- #aa0011
- #006c00
- #005e8d
- #6900d9
Closest CSS names
blueexact matchmediumblueΔEok 0.083royalblueΔEok 0.165slateblueΔEok 0.190darkblueΔEok 0.200darkslateblueΔEok 0.206