I don’t understand the primary constructor solutio...
# announcements
c
I don’t understand the primary constructor solution. Lemme try
hexString.toLong(16).toInt()
meanwhile 👍
r
I don't think @cygnus meant that message for you
c
I get an exception
java.lang.NumberFormatException: Invalid long: "0xFF3F51B5"
k
I think you need to split of the
0x
part.
2
r
Try
hexString.subString(2).toLong(16).toInt()
c
Ok. This translates
0xFF3F51B5
to
-12627531
. The colors are same. Thank you @karelpeeters @Ruckus! 🙂
👍 2