#colors rgba bytes to int and back?

35 messages · Page 1 of 1 (latest)

frosty skiff
#

I can only see that these numbers are being interpreted as signed integers

#

instead of unsigned

shy rune
#

sounds like an issue with your binding

#

they should have defined the color as having unsigned bytes

frosty skiff
#

the numbers printed are not exactly weird. they're 256 - x for x >= 128

shy rune
#

you can maybe cast them

torpid gorge
#

oh hmm

torpid gorge
shy rune
#

depends on what the author of jaylib intended

#

but if it was me, I'd say yes

torpid gorge
#

but yea, if thats the problem then its not the biggest of deals, because i can just translate them by hand a bit i think

shy rune
#

they should have defined the java version of the color struct using unsigned values not signed.

#

but this isn't a raylib issue

frosty skiff
#

wait is this java?

shy rune
#

yeah

frosty skiff
#

then it's clear, java has no unsigned

shy rune
#

then that'd be why

torpid gorge
shy rune
#

so this is a langauge limitation

frosty skiff
#

dafaq is val in Java

shy rune
#

you have to convert, or use a langauge that sucks less

torpid gorge
#

haha

shy rune
#

still not a raylib issue

#

raylib defines those fields as unsigned bytes

torpid gorge
#

you are not the first one saying that this language sucks

shy rune
#

I have used java before. I was not impressed

torpid gorge
#

okay, but thnx!, i am going to make my way around it

shy rune
#

I'm sure it's fine for some tasks

#

just none ones I have ever done.

torpid gorge
#

i just like how fun it is to write kotlin lol
and also creating andriod apps with it (but that has nothing to do with raylib)

shy rune
#

the inability to accurately represent the data in memory does not sound 'fun' to write in 🙂

torpid gorge
#

yea true, i ment clean
but yea, if you want to go for memory efficiency, then you really need to stay away from java

#

but the differentse between these 2 languages is not going to make a difference in effeciency for a simple 2D platformer

#

same goes for a simple mobile app

#

so then i prefere a easy to read language above a more memory managable language