I may be a little bit late, but try this :
ErrorCode MyTextUtils::ApplyTextAttributes(ITextModel * textModel, int32 position, int32 length, UID attributeUID, ClassID classID)
{
ErrorCode rc = kFailure;
do {
InterfacePtr<ITextAttrUID> textAttrUID(::CreateObject2<ITextAttrUID>(classID));
// Set our color attribute and store it:
textAttrUID->SetUIDData(attributeUID);
InterfacePtr<ICommand> pApplyTextAttrCmd ( Utils<ITextAttrUtils>()->BuildApplyTextAttrCmd(textModel, position, length, textAttrUID, kCharAttrStrandBoss));
rc = CmdUtils::ProcessCommand(pApplyTextAttrCmd);
} while(false);
return rc;
}
Use kTextAttrColorBoss for the classID, and the UID of your color for attributeUID
North America
Europe, Middle East and Africa
Asia Pacific