mysql> select color, hex(conv(color,16,10) | 0xc0c0c0) from colors; +--------+-----------------------------------+ | color | hex(conv(color,16,10) | 0xc0c0c0) | +--------+-----------------------------------+ | 1234ab | D2F4EB | +--------+-----------------------------------+