From 3a7fa386560f88bc7b65f457c604d3b2caccee4b Mon Sep 17 00:00:00 2001 From: cometj03 Date: Wed, 27 Dec 2023 12:21:21 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20ContentAlpha=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/yourssu/design/system/compose/base/YdsText.kt | 5 +++-- .../design/system/compose/foundation/YdsContentAlpha.kt | 5 +++++ 2 files changed, 8 insertions(+), 2 deletions(-) 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 50599d81..d7b8adb5 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 com.yourssu.design.system.compose.foundation.LocalContentColor +import com.yourssu.design.system.compose.foundation.LocalYdsContentAlpha import com.yourssu.design.system.compose.foundation.YdsTextStyle @Composable @@ -15,11 +16,11 @@ fun YdsText( text: String, modifier: Modifier = Modifier, color: Color = Color.Unspecified, - style: YdsTextStyle = LocalTextStyle.current + style: YdsTextStyle = LocalTextStyle.current, ) { val textColor = color.takeOrElse { style.color.takeOrElse { - LocalContentColor.current + LocalContentColor.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 }