CSSマスクモードプロパティ
例
マスクレイヤー画像を輝度マスクとして処理します。
.mask1 {
-webkit-mask-image: url(w3logo.png);
mask-image: url(w3logo.png);
-webkit-mask-size: 70%;
mask-size: 70%;
-webkit-mask-repeat: no-repeat;
mask-repeat: no-repeat;
mask-mode: luminance;
}
定義と使用法
このmask-mode
プロパティは、マスクレイヤーイメージを輝度マスクとして扱うか、アルファマスクとして扱うかを指定します。
デフォルト値: | マッチソース |
---|---|
遺伝性の: | いいえ |
アニメート可能: | 番号。アニメート可能について読む |
バージョン: | CSS3 |
JavaScript構文: | オブジェクト.style.maskMode = "alpha" |
ブラウザのサポート
表の数字は、プロパティを完全にサポートする最初のブラウザバージョンを示しています。
Property | |||||
---|---|---|---|---|---|
mask-mode | Not supported | Not supported | 53.0 | Not supported | Not supported |
CSS構文
mask-mode:
match-source|luminance|alpha|initial|inherit;
プロパティ値
Value | Description |
---|---|
match-source | If the mask-image property is an image (an image URL or a gradient), set mask-mode to alpha. If the mask-image property is an SVG <mask> element, use the <mask> element's mask-type property. This is default. |
luminance | Use the luminance values of the mask image as the mask values |
alpha | Use the alpha values of the mask image as the mask values |
initial | Sets this property to its default value. Read about initial |
inherit | Inherits this property from its parent element. Read about inherit |
関連ページ
CSSリファレンス:mask-imageプロパティ
CSSリファレンス:mask-originプロパティ
CSSリファレンス:mask-positionプロパティ
CSSリファレンス:mask-repeatプロパティ
CSSリファレンス:mask-sizeプロパティ
CSSチュートリアル:CSSマスキング