Hannah has half as many red mugs as yellow mugs, which means she has 12 * 0.5 = <<12*0.5=6>>6 red mugs.
Hannas has three times more blue mugs than red ones, which means 3 * 6 = <<3*6=18>>18 blue mugs.
So there are 40 - 18 - 6 - 12 = <<40-18-6-12=4>>4 mugs in a different color than mentioned.
#### 4