Function

createThemedRemoteColor

Creates a themed RemoteColor that resolves to different Android system colors in light and dark mode.

createThemedRemoteColor

Source set: Android
public fun RemoteColor.Companion.createThemedRemoteColor(
    @ColorRes lightColorRes: Int,
    @ColorRes darkColorRes: Int,
    @ColorInt lightFallback: Int,
    @ColorInt darkFallback: Int,
): RemoteColor

Creates a themed RemoteColor that resolves to different Android system colors in light and dark mode.

Parameters

lightColorRes The android.R.color resource ID for light mode.
darkColorRes The android.R.color resource ID for dark mode.
lightFallback The fallback ARGB color integer to use in light mode if the theme color cannot be resolved.
darkFallback The fallback ARGB color integer to use in dark mode if the theme color cannot be resolved.

Return

A RemoteColor representing the themed color.

createThemedRemoteColor

Source set: Android
public fun RemoteColor.Companion.createThemedRemoteColor(
    @ColorRes lightColorRes: Int,
    @ColorRes darkColorRes: Int,
    lightFallback: Color,
    darkFallback: Color,
): RemoteColor

Creates a themed RemoteColor that resolves to different Android system colors in light and dark mode.

Parameters

lightColorRes The android.R.color resource ID for light mode.
darkColorRes The android.R.color resource ID for dark mode.
lightFallback The fallback Color value to use in light mode if the theme color cannot be resolved.
darkFallback The fallback Color value to use in dark mode if the theme color cannot be resolved.

Return

A RemoteColor representing the themed color.

Jetpack Compose beyond MaterialFree components, screens and templates for apps that don’t look like Google’s. Copy them into your app, or let your coding agent add them.Browse for free

Content updated: