That loop is unnecessary. If you divide a [positive] number by 1.25, it will always become smaller, so you don't have to check for any color component being too big. Only creates overhead.