@@ -13,6 +13,13 @@ $surface-color-tokens: map.get(
1313 surface
1414);
1515
16+ /// 汎用的に使えるsurface colorを取得します。
17+ /// ページやビューなど最下層でbackground colorを持つ要素の上に乗った、形のあるオブジェクト表面の色がsurface colorです。
18+ ///
19+ /// @group color
20+ /// @example
21+ /// functions.get-surface-color(light, secondary)
22+ /// // “#f7f8fa”
1623@function get-surface-color ($brightness : light , $priority : primary ) {
1724 $tokens : map .get ($surface-color-tokens , base );
1825 $available-brightnesses : helpers .get-brightnesses ();
@@ -37,10 +44,22 @@ $surface-color-tokens: map.get(
3744 @return map .get ($brightness-tokens , $priority );
3845}
3946
47+ /// avatarのsurface colorを取得します。
48+ ///
49+ /// @group color
50+ /// @example
51+ /// functions.get-avatar-surface-color()
52+ /// // “#f7f8fa”
4053@function get-avatar-surface-color () {
4154 @return map .get ($surface-color-tokens , avatar );
4255}
4356
57+ /// bottom-navigationのsurface colorを取得します。
58+ ///
59+ /// @group color
60+ /// @example
61+ /// function get-bottom-navigation-surface-color(filled)
62+ /// // “#1f7acc”
4463@function get-bottom-navigation-surface-color ($appearance : white ) {
4564 $tokens : map .get ($surface-color-tokens , bottom-navigation );
4665 $available-appearances : helpers .get-bottom-navigation-appearances ();
@@ -55,6 +74,12 @@ $surface-color-tokens: map.get(
5574 @return map .get ($tokens , $appearance );
5675}
5776
77+ /// solidなappearanceのbuttonのグラデーションを構成するscrimのcolorを取得します。
78+ ///
79+ /// @group color
80+ /// @example
81+ /// function.get-solid-button-scrim-color(start)
82+ /// // “rgba(255, 255, 255, 0.25)”
5883@function get-solid-button-scrim-color ($position : start ) {
5984 $tokens : map .get (map .get (map .get ($surface-color-tokens , button ), solid ), scrim );
6085 $available-positions : start , end ;
@@ -69,6 +94,12 @@ $surface-color-tokens: map.get(
6994 @return map .get ($tokens , $position );
7095}
7196
97+ /// buttonのsurface colorを取得します。
98+ ///
99+ /// @group color
100+ /// @example
101+ /// function.get-button-surface-color($appearance: flat, $brightness: light, $color: neutral, $state: enabled)
102+ /// // “#585c63”
72103@function get-button-surface-color (
73104 $appearance : flat ,
74105 $brightness : light ,
@@ -156,6 +187,13 @@ $surface-color-tokens: map.get(
156187 }
157188}
158189
190+ /// 最終的なbutton表面の色を定義したbackground-imageのグラデーションを取得します。
191+ /// 内部でget-button-surface-color()を使っています。
192+ ///
193+ /// @group color
194+ /// @example
195+ /// function.get-button-surface-image($appearance: flat, $brightness: light, $color: neutral, $own-brightness: light, $state: enabled)
196+ /// // “linear-gradient(rgba(0, 0, 0, 0), rgba(0, 0, 0, 0)), linear-gradient(#585c63, #585c63)”
159197@function get-button-surface-image (
160198 $appearance : flat ,
161199 $brightness : light ,
@@ -243,6 +281,12 @@ $surface-color-tokens: map.get(
243281 }
244282}
245283
284+ /// checkboxのsurfaceのcolorを取得します。
285+ ///
286+ /// @group color
287+ /// @example
288+ /// function.get-checkbox-surface-color(enabled)
289+ /// // “#ffffff”
246290@function get-checkbox-surface-color ($states : (enabled)) {
247291 $tokens : map .get ($surface-color-tokens , checkbox );
248292 $available-states : helpers .get-states ();
@@ -263,6 +307,12 @@ $surface-color-tokens: map.get(
263307 }
264308}
265309
310+ /// ヘッダーの背景色を取得します
311+ ///
312+ /// @group color
313+ /// @example
314+ /// functions.get-header-surface-color($appearance: filled)
315+ /// // #1f7acc
266316@function get-header-surface-color ($appearance : white ) {
267317 $header-tokens : map .get ($surface-color-tokens , header );
268318 $available-appearances : helpers .get-header-appearances ();
@@ -277,12 +327,24 @@ $surface-color-tokens: map.get(
277327 @return map .get ($header-tokens , #{$appearance } );
278328}
279329
330+ /// プログレスインジケーターの全体を表すtrack(溝)部分のカラーを取得します
331+ ///
332+ /// @group color
333+ /// @example
334+ /// functions.get-progress-indicator-track-surface-color()
335+ /// // #e5f3ff
280336@function get-progress-indicator-track-surface-color () {
281337 $tokens : map .get ($surface-color-tokens , progress-indicator );
282338
283339 @return map .get ($tokens , track );
284340}
285341
342+ /// プログレスインジケーターの進捗を表すindicator部分のカラーを取得します
343+ ///
344+ /// @group color
345+ /// @example
346+ /// functions.get-progress-indicator-indicator-surface-color()
347+ /// // #3e93de
286348@function get-progress-indicator-indicator-surface-color () {
287349 $tokens : map .get ($surface-color-tokens , progress-indicator );
288350
@@ -293,10 +355,25 @@ $surface-color-tokens: map.get(
293355 @return get-surface-color ($brightness : light , $priority : primary );
294356}
295357
358+ /// スケルトン背景の背景色を取得します
359+ ///
360+ /// @group color
361+ /// @example
362+ /// functions.get-skeleton-surface-color()
363+ /// // rgba(0, 0, 0, 0.2)
296364@function get-skeleton-surface-color () {
297365 @return map .get ($surface-color-tokens , skeleton );
298366}
299367
368+ /// フィールド要素の背景色を取得します
369+ ///
370+ /// @group color
371+ /// @example
372+ /// functions.get-field-surface-color(
373+ /// $color: neutral,
374+ /// $state: enabled
375+ /// )
376+ /// // #f7f8fa
300377@function get-field-surface-color ($color : neutral , $state : enabled ) {
301378 $tokens : map .get ($surface-color-tokens , field );
302379 $color-tokens : map .get ($tokens , $color );
0 commit comments