I am trying to colorize a substring in my NSMutableAttributedString in Xamarin, but it seems to lack the correct constants,

What should I do there?
Update . This is approaching:
var s = new NSMutableAttributedString ("hello"); s.AddAttribute (CTStringAttributeKey.ForegroundColor , NSColor.Red, new NSRange (0, 3)); wordLabel.AttributedStringValue = s;
and gives

although the color on the screen is still black text!

Update2 Perhaps CTStringAttributeKey is incorrect, but no NSStringAttributeKey

c # xamarin
tofutim
source share