Fixes math bug in RGB