Use sprite.textureRect instead of calculating yourself
Color Picker copied from RagePixel1