Skip to content

Commit

Permalink
fix: color palette hex code barely visible for some colors
Browse files Browse the repository at this point in the history
  • Loading branch information
Bnyro committed Feb 3, 2025
1 parent da23136 commit f067ca1
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import androidx.compose.foundation.lazy.grid.items
import androidx.compose.foundation.shape.CircleShape
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Text
import androidx.compose.material3.contentColorFor
import androidx.compose.runtime.Composable
import androidx.compose.runtime.LaunchedEffect
import androidx.compose.runtime.getValue
Expand Down Expand Up @@ -63,15 +64,15 @@ fun InfoSheetColors(
verticalArrangement = Arrangement.spacedBy(10.dp),
horizontalArrangement = Arrangement.spacedBy(10.dp),
) {
items(items = colors) {
items(items = colors) { colorSwatch ->
val hexColor = String.format(
"#%06X",
0xFFFFFF and it.rgb
0xFFFFFF and colorSwatch.rgb
)
Box(
modifier = Modifier
.clip(CircleShape)
.background(Color(it.rgb))
.background(Color(colorSwatch.rgb))
.clickable {
clipboardManager.setText(AnnotatedString(hexColor))
},
Expand All @@ -80,7 +81,7 @@ fun InfoSheetColors(
Text(
hexColor,
style = MaterialTheme.typography.titleMedium,
color = Color.White,
color = Color(colorSwatch.bodyTextColor),
modifier = Modifier.padding(8.dp)
)
}
Expand Down

0 comments on commit f067ca1

Please sign in to comment.