It's because $color() returns the colour in what is, strictly speaking,
bgr format, with the highest-byte containing the blue information and the lowest-byte containing the red. It's not specific to colours 7 and 10, it's the same for all of them. This is not a bug, it's a common format for storing RGB values as a single number, often called an 'RGB triple'.
Here's a simple example of a conversion from an RGB triple to the traditional hex representation:
tokenize 44 $rgb($color(7))
echo -a $base($calc($1 * (2^16) + $2 * (2^8) + $3), 10, 16)