package com.pixelized.desktop.lwa.utils.extention

import androidx.compose.animation.animateColorAsState
import androidx.compose.ui.Modifier
import androidx.compose.ui.composed
import androidx.compose.ui.draw.drawWithContent
import androidx.compose.ui.geometry.Size
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.drawscope.DrawStyle
import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.dp

fun Modifier.ribbon(
    width: Dp = 4.dp,
    color: Color,
): Modifier = composed {
    val animatedColor = animateColorAsState(
        targetValue = color,
    )
    return@composed drawWithContent {
        drawContent()
        drawRect(
            color = animatedColor.value,
            size = Size(
                width = width.toPx(),
                height = size.height,
            ),
        )
    }
}