All Downloads are FREE. Search and download functionalities are using the official Maven repository.

commonMain.io.github.lyxnx.compose.pine.RadioButtonDefaults.kt Maven / Gradle / Ivy

There is a newer version: 1.2.2
Show newest version
package io.github.lyxnx.compose.pine

import androidx.compose.runtime.Composable
import androidx.compose.ui.graphics.Color
import io.github.lyxnx.compose.ui.AnimatedInteractionStateColorSelector

/**
 * Contains the default values used by a [RadioButton]
 */
public object RadioButtonDefaults {

    /**
     * Creates a [RadioButtonColors] instance that represents the colors in different states
     */
    @Composable
    public fun radioButtonColors(
        unselectedBorderColor: Color = PineTheme.colors.grey300,
        pressedUnselectedBorderColor: Color = PineTheme.colors.primary500,
        focusedUnselectedBorderColor: Color = PineTheme.colors.primary500,
        disabledUnselectedBorderColor: Color = PineTheme.colors.grey300,
        selectedBorderColor: Color = PineTheme.colors.primary500,
        pressedSelectedBorderColor: Color = PineTheme.colors.primary600,
        focusedSelectedBorderColor: Color = PineTheme.colors.primary400,
        disabledSelectedBorderColor: Color = PineTheme.colors.grey300,
        unselectedBackgroundColor: Color = PineTheme.colors.background,
        pressedUnselectedBackgroundColor: Color = PineTheme.colors.primary100,
        focusedUnselectedBackgroundColor: Color = PineTheme.colors.background,
        disabledUnselectedBackgroundColor: Color = PineTheme.colors.grey300,
        selectedBackgroundColor: Color = PineTheme.colors.primary500,
        pressedSelectedBackgroundColor: Color = PineTheme.colors.primary600,
        focusedSelectedBackgroundColor: Color = PineTheme.colors.primary400,
        disabledSelectedBackgroundColor: Color = PineTheme.colors.grey300,
        indicatorColor: Color = PineTheme.colors.white,
        pressedIndicatorColor: Color = PineTheme.colors.white,
        focusedIndicatorColor: Color = PineTheme.colors.white,
        disabledIndicatorColor: Color = PineTheme.colors.background,
        focusedShadowColor: Color = PineTheme.colors.primary600.copy(alpha = 0.5f)
    ): RadioButtonColors = RadioButtonColors(
        unselectedBorderColor = AnimatedInteractionStateColorSelector(
            default = unselectedBorderColor,
            pressed = pressedUnselectedBorderColor,
            focused = focusedUnselectedBorderColor,
            disabled = disabledUnselectedBorderColor
        ),
        selectedBorderColor = AnimatedInteractionStateColorSelector(
            default = selectedBorderColor,
            pressed = pressedSelectedBorderColor,
            focused = focusedSelectedBorderColor,
            disabled = disabledSelectedBorderColor
        ),
        unselectedBackgroundColor = AnimatedInteractionStateColorSelector(
            default = unselectedBackgroundColor,
            pressed = pressedUnselectedBackgroundColor,
            focused = focusedUnselectedBackgroundColor,
            disabled = disabledUnselectedBackgroundColor
        ),
        selectedBackgroundColor = AnimatedInteractionStateColorSelector(
            default = selectedBackgroundColor,
            pressed = pressedSelectedBackgroundColor,
            focused = focusedSelectedBackgroundColor,
            disabled = disabledSelectedBackgroundColor
        ),
        indicatorColor = AnimatedInteractionStateColorSelector(
            default = indicatorColor,
            pressed = pressedIndicatorColor,
            focused = focusedIndicatorColor,
            disabled = disabledIndicatorColor
        ),
        focusedShadowColor = focusedShadowColor
    )
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy