I speculate it is because 255 is at the boundary of 2^8, meaning 255 in binary = 11111111. Maybe because all bits are on the floating point math has the desired rounding up.It just seems to get rounding right all the time, by pure chance.
Search found 5 matches
- Fri May 25, 2018 5:45 am
- Forum: Libraries and Tools
- Topic: a working setColor compatibilty multiplier
- Replies: 17
- Views: 28471
Re: a working setColor compatibilty multiplier
- Thu May 24, 2018 12:22 pm
- Forum: Libraries and Tools
- Topic: a working setColor compatibilty multiplier
- Replies: 17
- Views: 28471
Re: a working setColor compatibilty multiplier
grump wrote: Can you show an example where that happens? I had that only happen with r * (1 / 255), not with r / 255 No. I don't know how multiply is different than division for setColor() parameters but dividing does work. And it looks nicer. ;) Thanks for the correction. local CDIV = love._versio...
- Thu May 24, 2018 9:54 am
- Forum: Libraries and Tools
- Topic: a working setColor compatibilty multiplier
- Replies: 17
- Views: 28471
Re: a working setColor compatibilty multiplier
This thread could be moved to General but the point is for libraries which are made to work with ALL VERSIONS and to be ACCURATE. I see libraries using r/255, g/255, b/255 but that produces colors on the screen which can be off by 1 for each color component. Not a big problem but this can be avoided.
- Thu May 17, 2018 1:16 am
- Forum: Libraries and Tools
- Topic: a working setColor compatibilty multiplier
- Replies: 17
- Views: 28471
a working setColor compatibilty multiplier
When making a library compatible with all versions concerning the new setColor parameters range such that lg.setColor(r, g, b, a or 255) becomes lg.setColor(r * CDIV, g * CDIV, b * CDIV, (a or 255) * CDIV) using the following formula is not exactly accurate. local CDIV = love._version_major >= 11 an...
- Fri May 11, 2018 8:24 am
- Forum: Libraries and Tools
- Topic: GOOi, an Android-Oriented GUI Library
- Replies: 134
- Views: 190858
Re: GOOi, an Android-Oriented GUI Library
I worked on updating Gooi with the color range changes in Love 11. The colors are better but not 100%. Get here:
https://drive.google.com/open?id=1FpOmO ... o7X4taF4km
https://drive.google.com/open?id=1FpOmO ... o7X4taF4km