Xojo Developer Conference
Join us from 25th to 27th April 2018 in Denver.

Platforms to show: All Mac Windows Linux Cross-Platform

FAQ - Graphics.How do I get the proper highlight color on Mac OS X for active/inactive selection?

Answer: You can use functions from NSColor to get proper highlight color in RGB:
Function ProperHighlightColor(active as Boolean) As Color
#if TargetCocoa
Dim theColor As NSColorMBS
If active Then
theColor = NSColorMBS.alternateSelectedControlColor
theColor = NSColorMBS.secondarySelectedControlColor
End If

Dim rgbColor As NSColorMBS = theColor.colorUsingColorSpaceName(NSColorSpaceMBS.NSCalibratedRGBColorSpace)
If rgbColor <> Nil Then
Dim red as Integer = rgbColor.redComponent * 255.0
Dim green as Integer = rgbColor.greenComponent * 255.0
Dim blue as Integer = rgbColor.blueComponent * 255.0
Return RGB(red, green, blue)
Return HighlightColor
End If
return HighlightColor
End Function
Notes: As you see we convert color to Calibrated RGB for best results.

See also:

MBS Xojo PDF Plugins