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

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

package io.github.lyxnx.compose.pine

import androidx.compose.runtime.Composable
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.DpSize
import androidx.compose.ui.unit.dp

/**
 * Contains the default values used by [RatingDisplay]
 */
public object RatingDefaults {

    /**
     * Default spacing between each rating icon
     */
    public val ItemSpacing: Dp = 4.dp

    /**
     * Default size of each rating icon
     */
    public val ItemSize: DpSize = DpSize(24.dp, 24.dp)

    /**
     * Default maximum rating value
     *
     * This is used to determine the number of rating icons to display
     */
    public const val MaxRating: Int = 5

    /**
     * Creates a [RatingColors] instance that represents the colors for [RatingType.Star] in different states
     */
    @Composable
    public fun starColors(
        iconColor: Color = PineTheme.colors.warning500,
        pressedIconColor: Color = PineTheme.colors.warning400,
    ): RatingColors = RatingColors(
        iconColor = iconColor,
        pressedIconColor = pressedIconColor,
    )

    /**
     * Creates a [RatingColors] instance that represents the colors for [RatingType.Heart] in different states
     */
    @Composable
    public fun heartColors(
        iconColor: Color = PineTheme.colors.error500,
        pressedIconColor: Color = PineTheme.colors.error400,
    ): RatingColors = RatingColors(
        iconColor = iconColor,
        pressedIconColor = pressedIconColor,
    )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy