<div class="container">
<div class="box hsl" style="--hue: 60">あ</div>
<div class="box hsl" style="--hue: 120">あ</div>
<div class="box hsl" style="--hue: 180">あ</div>
<div class="box hsl" style="--hue: 240">あ</div>
<div class="box hsl" style="--hue: 300">あ</div>
<div class="box hsl" style="--hue: 360">あ</div>
</div>
<div class="container">
<div class="box oklch" style="--hue: 60">あ</div>
<div class="box oklch" style="--hue: 120">あ</div>
<div class="box oklch" style="--hue: 180">あ</div>
<div class="box oklch" style="--hue: 240">あ</div>
<div class="box oklch" style="--hue: 300">あ</div>
<div class="box oklch" style="--hue: 360">あ</div>
</div>
.container {
display: flex;
gap: 10px;
width: fit-content;
margin: 10px auto;
}
.box {
width: 80px;
height: 80px;
color: #fff;
font-size: 40px;
line-height: 80px;
text-align: center;
}
.hsl {
background-color: hsl(var(--hue) 70% 70%);
}
.oklch {
background-color: oklch(70% 0.15 var(--hue));
}
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.