Micro update of the portrait blood overlay.

Add a color animation tied to the total domage received.
This commit is contained in:
Thomas Andres Gomez 2025-03-12 22:54:26 +01:00
parent a93bb9d3f5
commit fce085f70d
2 changed files with 6 additions and 2 deletions

View file

@ -2,6 +2,7 @@ package com.pixelized.desktop.lwa.ui.screen.campaign.player.ribbon
import androidx.compose.animation.AnimatedContent import androidx.compose.animation.AnimatedContent
import androidx.compose.animation.AnimatedVisibility import androidx.compose.animation.AnimatedVisibility
import androidx.compose.animation.animateColorAsState
import androidx.compose.animation.core.EaseOutCirc import androidx.compose.animation.core.EaseOutCirc
import androidx.compose.animation.core.animateFloatAsState import androidx.compose.animation.core.animateFloatAsState
import androidx.compose.animation.core.tween import androidx.compose.animation.core.tween
@ -183,10 +184,13 @@ private fun BloodOverlay(
targetValue = min(maxHp, max(0f, (maxHp - hp) / maxHp)), targetValue = min(maxHp, max(0f, (maxHp - hp) / maxHp)),
animationSpec = tween(durationMillis = 350, easing = EaseOutCirc) animationSpec = tween(durationMillis = 350, easing = EaseOutCirc)
) )
val animatedColor = animateColorAsState(
targetValue = bloodColor.copy(alpha = ((maxHp - hp) / maxHp) / 4f + .25f)
)
Box( Box(
modifier = modifier modifier = modifier
.fillMaxWidth() .fillMaxWidth()
.fillMaxHeight(fraction = animatedRatio.value) .fillMaxHeight(fraction = animatedRatio.value)
.background(color = bloodColor) .background(color = animatedColor.value)
) )
} }

View file

@ -83,7 +83,7 @@ fun darkLwaColorTheme(
), ),
portrait: LwaColors.Portrait = LwaColors.Portrait( portrait: LwaColors.Portrait = LwaColors.Portrait(
levelUp = LwaColorPalette.Gold, levelUp = LwaColorPalette.Gold,
blood = LwaColorPalette.Blood.copy(alpha = .25f), blood = LwaColorPalette.Blood,
), ),
chat: LwaColors.Chat = LwaColors.Chat( chat: LwaColors.Chat = LwaColors.Chat(
timestamp = base.secondary, timestamp = base.secondary,