OKLCH Pad
A copy-paste color pickers component in pure HTML & CSS. Zero dependencies, framework-agnostic, MIT-licensed.
Color PickersHTMLCSSany framework
oklch(63% 0.19 292)
Copy into your project
HTML
<div class="nuda-cpk2-oklch-pad">
<div class="nuda-cpk2-oklch-pad__pad" aria-hidden="true">
<span class="nuda-cpk2-oklch-pad__handle" role="slider" tabindex="0"
aria-label="Lightness and chroma" aria-valuemin="0" aria-valuemax="100"
aria-valuenow="63" aria-valuetext="Lightness 63%, chroma 0.19"
style="transform:translate(120px,30px)"></span>
</div>
<div class="nuda-cpk2-oklch-pad__rail">
<label id="cpk2-oklch-pad-hue-label" for="cpk2-oklch-pad-hue">Hue</label>
<input id="cpk2-oklch-pad-hue" class="nuda-cpk2-oklch-pad__hue" type="range"
min="0" max="360" value="292" aria-labelledby="cpk2-oklch-pad-hue-label"
aria-valuetext="Hue 292 degrees, violet">
</div>
<div class="nuda-cpk2-oklch-pad__readout" aria-live="polite">oklch(63% 0.19 292)</div>
</div>CSS
.nuda-cpk2-oklch-pad {
display: flex;
flex-direction: column;
gap: 10px;
padding: 12px;
background: rgba(255,255,255,.02);
border: 1px solid rgba(255,255,255,.06);
border-radius: 12px;
width: 100%;
max-width: 240px;
}
.nuda-cpk2-oklch-pad__pad {
position: relative;
height: 120px;
border-radius: 8px;
background: linear-gradient(to top,#000,transparent),linear-gradient(to right,#8f8f97,#9d6dff);
cursor: crosshair;
}
@supports (color:oklch(50% 0.1 180)) {
.nuda-cpk2-oklch-pad__pad {
background: linear-gradient(to top,#000,transparent),linear-gradient(to right,#8f8f97,oklch(63% 0.19 292));
}
}
.nuda-cpk2-oklch-pad__handle {
position: absolute;
top: 0;
left: 0;
width: 16px;
height: 16px;
margin: -8px;
border-radius: 50%;
border: 2px solid #fafafa;
box-shadow: 0 0 0 1px rgba(0,0,0,.5),0 2px 6px rgba(0,0,0,.5);
cursor: grab;
transition: transform .18s cubic-bezier(.16,1,.3,1);
}
.nuda-cpk2-oklch-pad__handle:hover {
transform: translate(120px,30px) scale(1.15);
}
.nuda-cpk2-oklch-pad__handle:focus-visible {
outline: 2px solid #e4ff54;
outline-offset: 2px;
}
.nuda-cpk2-oklch-pad__rail {
display: flex;
align-items: center;
gap: 8px;
}
.nuda-cpk2-oklch-pad__rail label {
font-size: 10px;
color: #777;
width: 24px;
}
.nuda-cpk2-oklch-pad__hue {
-webkit-appearance: none;
appearance: none;
flex: 1;
height: 44px;
background: transparent;
cursor: pointer;
}
.nuda-cpk2-oklch-pad__hue::-webkit-slider-runnable-track {
height: 10px;
border-radius: 99px;
background: linear-gradient(90deg,#ff5e7a,#ffb45e,#e4ff54,#6ee7b7,#62b6ff,#9d6dff,#ff6dd4,#ff5e7a);
}
.nuda-cpk2-oklch-pad__hue::-moz-range-track {
height: 10px;
border-radius: 99px;
background: linear-gradient(90deg,#ff5e7a,#ffb45e,#e4ff54,#6ee7b7,#62b6ff,#9d6dff,#ff6dd4,#ff5e7a);
}
.nuda-cpk2-oklch-pad__hue::-webkit-slider-thumb {
-webkit-appearance: none;
appearance: none;
width: 18px;
height: 18px;
margin-top: -4px;
border-radius: 50%;
background: #fafafa;
border: 2px solid #0c0c10;
box-shadow: 0 0 0 1px rgba(255,255,255,.4);
cursor: grab;
transition: transform .2s;
}
.nuda-cpk2-oklch-pad__hue::-webkit-slider-thumb:hover {
transform: scale(1.15);
}
.nuda-cpk2-oklch-pad__hue::-moz-range-thumb {
width: 18px;
height: 18px;
border-radius: 50%;
background: #fafafa;
border: 2px solid #0c0c10;
cursor: grab;
}
.nuda-cpk2-oklch-pad__hue:focus-visible {
outline: none;
}
.nuda-cpk2-oklch-pad__hue:focus-visible::-webkit-slider-thumb {
outline: 2px solid #e4ff54;
outline-offset: 2px;
}
.nuda-cpk2-oklch-pad__readout {
font-family: ui-monospace,SFMono-Regular,Menlo,monospace;
font-size: 11px;
color: #fafafa;
font-weight: 600;
text-align: center;
padding: 6px;
background: rgba(255,255,255,.03);
border: 1px solid rgba(255,255,255,.06);
border-radius: 6px;
}
@media (prefers-reduced-motion:reduce) {
.nuda-cpk2-oklch-pad__handle,.nuda-cpk2-oklch-pad__hue::-webkit-slider-thumb {
transition: none;
}
}
How to use OKLCH Pad
Paste the HTML where you need it and the CSS into a global stylesheet (or a <style> tag). Every class is prefixed nuda- so it never collides with Tailwind or your own styles. Tweak the CSS custom properties to match your design system.
Works in React, Vue, Svelte, Astro, Next.js, Nuxt, Laravel Blade, Django, Rails — or a single .html file. No npm install, no build step.