If it's not a background color (that is, when bgColor != ALTSEM_BG_DEFAULT) then this needs to be wrapped in a call to dimmedColorFrom. To avoid this kind of bug, it would be better if colorForCode:alternateSemantics:bold:isBackground handled the 24-bit case itself (ie, change it to take a colorMode: arg instead of the alternateSemantics: arg it currently takes).