Convert Hex to GLSL & WGSL vec4

Convert #Hex into normalized 0.0–1.0 GLSL vec3/vec4, WebGPU WGSL, and Three.js gamma-decoded linear-light shader vectors.

0 bytes sent
  • 100% browser-local
  • Zero server transfers
  • CSS Color 4 precision

or drop a color string, CSS/JSON snippet, or file here · Ctrl V to paste · Paste Hex, RGB, HSL, OKLCH or use Screen Eyedropper

Instant Before & After Specimen

GLSL + WGSL + Unity Float4
Input Samplebrand.hex
#2563EB
Expected OutputOUTPUT
// GLSL
vec4(0.1451, 0.3882, 0.9216, 1.0)
// WGSL
vec4f(0.1451, 0.3882, 0.9216, 1.0)
// Unity C#
new Color(0.1451f, 0.3882f, 0.9216f, 1.0f)

How to use Hex to GLSL Shader

Hex to GLSL Shader — cleanly inside your local browser with zero server transfers.

  1. Enter or pick a colorType Hex, RGB, HSL, OKLCH, or Lab — or click Screen Eyedropper and live sliders.
  2. Inspect math & gamutReview exact CSS Color 4 readouts, sRGB vs Display P3 status, and profile options.
  3. Copy, chain, or exportCopy ready CSS/JSON snippets, download binary swatch files, or pipe directly to related Colr tools.
Format specs:HEX (.css / .txt)

Frequently asked questions

Why offer Linear RGB alongside standard sRGB floats for GLSL?

Lighting equations in physically based shaders (Three.js / WebGPU) operate in linear light; feeding raw gamma floats washes out dark shadows.

Does it emit WebGPU WGSL vec4f syntax?

Yes — switch targets in options between GLSL, WGSL, and Three.js.