You are using the ternary operator correctly, but the if
portion is malformed.
You are essentially testing if get_color($color_1)
is equal to true
because 'Dark Blue' OR 'Light Blue'
equals true
.
You'll need to test each value independantly, like this:
$criteria = array(
'is_blue' => get_color($color_1) == 'Dark Blue' OR get_color($color_1) == 'Light Blue' ? true : false,
'is_red' => get_color($color_2) == 'Dark Red' OR get_color($color_2) == 'Light Red' ? true : false
);