Convert colors to unsigned int before converting them to string

This commit is contained in:
MM20 2023-08-23 19:22:43 +02:00
parent 5f8dd2756d
commit bf9035bb2c
No known key found for this signature in database
GPG Key ID: 0B61A8F2DEAFA389

View File

@ -59,14 +59,14 @@ data class ColorRef(
val tone: Int,
) : Color {
override fun toString(): String {
return "\$${color.toString()}.$tone"
return "\$$color.$tone"
}
}
@JvmInline
value class StaticColor(val color: Int) : Color {
override fun toString(): String {
return "#${color.toString(16).padStart(6, '0')}"
return "#${color.toUInt().toString(16).padStart(8, '0')}"
}
}