From 4811d76112613f205016433488ca1eb650664199 Mon Sep 17 00:00:00 2001 From: Jung Haesung <48352078+cometj03@users.noreply.github.com> Date: Mon, 15 Jan 2024 13:27:08 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20ContentAlpha=20=EC=B6=94=EA=B0=80=20(#2?= =?UTF-8?q?38)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/yourssu/design/system/compose/base/YdsText.kt | 3 ++- .../design/system/compose/foundation/YdsContentAlpha.kt | 5 +++++ 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 compose/src/main/java/com/yourssu/design/system/compose/foundation/YdsContentAlpha.kt diff --git a/compose/src/main/java/com/yourssu/design/system/compose/base/YdsText.kt b/compose/src/main/java/com/yourssu/design/system/compose/base/YdsText.kt index f71d104b..2281aadf 100644 --- a/compose/src/main/java/com/yourssu/design/system/compose/base/YdsText.kt +++ b/compose/src/main/java/com/yourssu/design/system/compose/base/YdsText.kt @@ -8,6 +8,7 @@ import androidx.compose.ui.Modifier import androidx.compose.ui.graphics.Color import androidx.compose.ui.graphics.takeOrElse import androidx.compose.ui.text.TextLayoutResult +import com.yourssu.design.system.compose.foundation.LocalYdsContentAlpha import com.yourssu.design.system.compose.foundation.LocalYdsContentColor import com.yourssu.design.system.compose.foundation.YdsTextStyle @@ -21,7 +22,7 @@ fun YdsText( ) { val textColor = color.takeOrElse { style.color.takeOrElse { - LocalYdsContentColor.current + LocalYdsContentColor.current.copy(alpha = LocalYdsContentAlpha.current) } } diff --git a/compose/src/main/java/com/yourssu/design/system/compose/foundation/YdsContentAlpha.kt b/compose/src/main/java/com/yourssu/design/system/compose/foundation/YdsContentAlpha.kt new file mode 100644 index 00000000..0e5c9c3c --- /dev/null +++ b/compose/src/main/java/com/yourssu/design/system/compose/foundation/YdsContentAlpha.kt @@ -0,0 +1,5 @@ +package com.yourssu.design.system.compose.foundation + +import androidx.compose.runtime.compositionLocalOf + +val LocalYdsContentAlpha = compositionLocalOf { 1f }