Previously mistakenly used the BGR format instead of the RGB. Probably won't make much of a difference for anything, but may affect #17881 if my theory about it is correct. Also minor cleanups.