Esempio n. 1
0
        public static Color ToSDColor(this NSColor color)
        {
            if (NSColorSupportsType && color.Type == NSColorType.Catalog && color.CatalogNameComponent == "System")
            {
                return(color.ColorNameComponent switch {
                    // FIXME: Reverse of ToNSColor, not always correct
                    //"windowFrameColor" => SystemColors.ActiveBorder,
                    "gridColor" => SystemColors.ActiveCaption,
                    "headerTextColor" => SystemColors.ActiveCaptionText,
                    "textColor" => textColor,
                    "textBackgroundColor" => textBackgroundColor,
                    "controlColor" => SystemColors.Control,
                    "controlTextColor" => SystemColors.ControlText,
                    "controlShadowColor" => SystemColors.ControlDark,
                    "controlDarkShadowColor" => SystemColors.ControlDarkDark,
                    "controlHighlightColor" => SystemColors.ControlLight,
                    "controlBackgroundColor" => SystemColors.ControlLightLight,
                    "disabledControlTextColor" => SystemColors.GrayText,
                    "selectedTextBackgroundColor" => SystemColors.Highlight,
                    "selectedTextColor" => SystemColors.HighlightText,
                    "scrollBarColor" => SystemColors.ScrollBar,
                    "windowBackgroundColor" => SystemColors.Window,
                    "windowFrameTextColor" => SystemColors.WindowText,
                    "windowFrameColor" => SystemColors.WindowFrame,

                    /*"controlColor" => SystemColors.ButtonFace,
                     * "controlHighlightColor" => SystemColors.ButtonHighlight,
                     * "controlShadowColor" => SystemColors.ButtonShadow, */
                    _ => Color.FromArgb(color.ToArgb())
                });
Esempio n. 2
0
 public static uint ToUArgb(this NSColor color)
 {
     return((uint)color.ToArgb());
 }