Hello everyone I am just learning the ropes of kot...
# compose
b
Hello everyone I am just learning the ropes of kotlin and compose so I'm not sure where this question fits in but I have a mutableState<long> parameter that I want to use as a color-indicator, but when I do "Color(exampleClass.longVar.value)", it does not give me a a working color. Any ideas on why this is happening?
r
What did you put in that
Long
exactly?
b
I got all of my values using the palette on the margin when using Color, so one of my values is 0xFFE41D1D
r
that’s a “color int”
you need to add
.toInt()
at the end
(because of how Kotlin handles hex constants unfortunately)
(if the alpha is >0x80, it’s treated as a
long
instead of an
int
)
b
Got it. thank you!