filterの設定例
CSSフィルター(filter)を使って要素に対して明度や彩度を変更することができます。ホバー時の状態変化によく利用しているのを見かけるようになったので、いくつか設定例をまとめておきます。
目次
- ぼかし(blur)
- 明るさ(brightness)
- コントラスト(contrast)
- 影(drop-shadow)
- グレースケール(grayscale)
- 色の反転(invert)
- 透過(opacity)
- 色相(hue-rotate)
- 彩度(saturate)
- セピア(sepia)
ぼかし(blur)
filter: blur(5px);



明るさ(brightness)
filter: brightness(120%);
/* or */
filter: brightness(1.2);



コントラスト(contrast)
filter: contrast(120%);



影(drop-shadow)
filter: drop-shadow(10px 10px 10px gray);




グレースケール(grayscale)
filter: grayscale(50%);



色の反転(invert)
filter: invert(75%);



透過(opacity)
filter: opacity(50%);



色相(hue-rotate)
filter: hue-rotate(90deg);




彩度(saturate)
filter: saturate(50%);



セピア(sepia)
filter: sepia(50%);


