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

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

package io.github.lyxnx.compose.pine

import androidx.compose.runtime.Composable
import androidx.compose.runtime.staticCompositionLocalOf
import androidx.compose.ui.unit.dp
import io.github.lyxnx.compose.ui.DropShadow

internal val LocalShadows = staticCompositionLocalOf { PineShadowsImpl }

/**
 * Represents the shadows used within the Pine theme
 */
public interface PineShadows {

    @get:Composable
    public val extraSmall: DropShadow

    @get:Composable
    public val small: DropShadow

    @get:Composable
    public val medium: DropShadow

    @get:Composable
    public val large: DropShadow

    @get:Composable
    public val extraLarge: DropShadow

}

internal object PineShadowsImpl : PineShadows {

    override val extraSmall: DropShadow
        @Composable
        get() = DropShadow(
            color = PineTheme.colors.inverted.copy(alpha = 0.06f),
            blurRadius = 3.dp,
            offsetY = 1.dp
        )

    override val small: DropShadow
        @Composable
        get() = DropShadow(
            color = PineTheme.colors.inverted.copy(alpha = 0.1f),
            blurRadius = 8.dp,
            offsetY = 4.dp,
            spread = (-2).dp
        )

    override val medium: DropShadow
        @Composable
        get() = DropShadow(
            color = PineTheme.colors.inverted.copy(alpha = 0.08f),
            blurRadius = 16.dp,
            offsetY = 12.dp,
            spread = (-4).dp
        )

    override val large: DropShadow
        @Composable
        get() = DropShadow(
            color = PineTheme.colors.inverted.copy(alpha = 0.08f),
            blurRadius = 24.dp,
            offsetY = 20.dp,
            spread = (-4).dp
        )

    override val extraLarge: DropShadow
        @Composable
        get() = DropShadow(
            color = PineTheme.colors.inverted.copy(alpha = 0.18f),
            blurRadius = 48.dp,
            offsetY = 24.dp,
            spread = (-12).dp
        )

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy