colors.py
colors.py copied to clipboard
Conventional 0-255 colors values doesn't accept floats
Rounding the inputs for RGB as conventionally 0-255 doesn't take floats. Closes https://github.com/mattrobenolt/colors.py/issues/8
Is there some reference that says this is strictly true? I feel like typically they are integers, but not sure why a float wouldn’t be allowed.
If it wasn't strictly true and we did included decimals it would be a lot more than 16777216 colors (24-bit). Which is why I thought it made sense :) Also most (all I tried) software's doesn't accept floats for 0-255 color values.
Oh, I guess that makes a lot of logical sense, you'd be increasing the number of colors.
I guess from my perspective, I was trying to maintain lossless conversions, but technically you can't do that.
I wonder if it makes sense to store as a floating point internally, but use the r/g/b values as integers for output only.
I wonder if it makes sense to store as a floating point internally, but use the r/g/b values as integers for output only.
I think this would make a lot of sense. Wouldn't make it as "lossy" to convert to RGB.
But then data loss would be expected if you go from 32 bit -> 16 bit -> 32 bit