Skip to content

Commit

Permalink
Merge pull request #111 from laco-dev/feature/#110
Browse files Browse the repository at this point in the history
#110 [designsystem] 테마에 맞는 이미지를 가져오기 위한 편의 함수 추가
  • Loading branch information
laco-dev authored Jul 26, 2023
2 parents 24d1138 + 79a19fe commit 5d518f7
Showing 1 changed file with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package com.droidknights.app2023.core.designsystem.res

import androidx.annotation.DrawableRes
import androidx.compose.runtime.Composable
import androidx.compose.ui.graphics.painter.Painter
import androidx.compose.ui.res.painterResource
import com.droidknights.app2023.core.designsystem.theme.LocalDarkTheme

@Composable
fun rememberPainterResource(
@DrawableRes lightId: Int,
@DrawableRes darkId: Int = lightId,
): Painter = painterResource(id = if (LocalDarkTheme.current) darkId else lightId)

0 comments on commit 5d518f7

Please sign in to comment.