fixed upper out-of-bounds check for color RGB strings