COLOR / 051

HSL color

色相・彩度・明度
色相を回転させ、彩度と明度を分けて指定する色の表し方です。

実際のHTML・CSSで描かれた見本です。

ラボで詳しく試す ↗

ひとつ試すなら

どこが変わるかを観察して、似た表現と見比べてみよう。

こんなときに

色相をそろえたバリエーションをつくるとき。

仕組みと使い方

HSLの明度が同じでも、色相ごとの見た目の明るさはそろいません。

hsl色相彩度明度
実装コードを見る
<style>
.sample{width:100%;height:100%;min-height:190px;display:grid;place-items:center;position:relative;overflow:hidden;box-sizing:border-box;font-family:Arial,'Hiragino Kaku Gothic ProN',Meiryo,sans-serif;color:#20211d;background:#f1f0e9;padding:22px}.sample *{box-sizing:border-box}.sample button,.sample input,.sample summary{font:inherit}.sample button,.sample summary,.sample label{touch-action:manipulation}.sample :focus-visible{outline:3px solid #6050bf;outline-offset:5px}.sample small{font-size:10px;line-height:1.5}.sample .editable{margin:0}.sample svg{max-width:100%;height:auto}
.sample .hues{display:flex;width:100%;max-width:260px;height:118px}.sample i{flex:1;background:hsl(var(--h) 70% 70%);display:grid;align-items:end;padding-bottom:12px;text-align:center;font-style:normal;font-size:10px}.sample i:nth-child(1){--h:30}.sample i:nth-child(2){--h:90}.sample i:nth-child(3){--h:150}.sample i:nth-child(4){--h:210}.sample i:nth-child(5){--h:270}
</style>
<div class="sample">
<div class="hues"><i>30°</i><i>90°</i><i>150°</i><i>210°</i><i>270°</i></div>
</div>