Adding logic to update the rgb registers.