Implement RGB arithmetic, fix a few bugs with conversion