Table of Contents

Class NSColor

Namespace
CarinaStudio.MacOS.AppKit
Assembly
CarinaStudio.AppBase.MacOS.dll

NSColor.

public class NSColor : NSObject, IDisposable, IEquatable<NSObject>
Inheritance
NSColor
Implements
Inherited Members
Extension Methods

Properties

AlphaComponent

Get alpha component.

public double AlphaComponent { get; }

Property Value

double

AlternateSelectedControl

Similar to SelectedControlColor.

public static NSColor AlternateSelectedControl { get; }

Property Value

NSColor

AlternateSelectedControlText

Similar to SelectedControlTextColor.

public static NSColor AlternateSelectedControlText { get; }

Property Value

NSColor

Black

Black.

public static NSColor Black { get; }

Property Value

NSColor

Blue

Blue.

public static NSColor Blue { get; }

Property Value

NSColor

BlueComponent

Get blue component.

public double BlueComponent { get; }

Property Value

double

Brown

Brown.

public static NSColor Brown { get; }

Property Value

NSColor

CMYK

Get cyan, magenta, yellow, black and alpha of color.

public (double, double, double, double, double) CMYK { get; }

Property Value

(double, double, double, double, double)

Clear

Transparent.

public static NSColor Clear { get; }

Property Value

NSColor

ColorSpace

Get color space.

public NSColorSpace? ColorSpace { get; }

Property Value

NSColorSpace

Control

Control face and old window background color.

public static NSColor Control { get; }

Property Value

NSColor

ControlBackground

Background of large controls.

public static NSColor ControlBackground { get; }

Property Value

NSColor

ControlDarkShadow

Darker border for controls.

public static NSColor ControlDarkShadow { get; }

Property Value

NSColor

ControlHighlight

Light border for controls.

public static NSColor ControlHighlight { get; }

Property Value

NSColor

ControlLightHighlight

Lighter border for controls.

public static NSColor ControlLightHighlight { get; }

Property Value

NSColor

ControlShadow

Dark border for controls.

public static NSColor ControlShadow { get; }

Property Value

NSColor

ControlText

Text on controls.

public static NSColor ControlText { get; }

Property Value

NSColor

Cyan

Cyan.

public static NSColor Cyan { get; }

Property Value

NSColor

DarkGray

Dark gray.

public static NSColor DarkGray { get; }

Property Value

NSColor

DisabledControlText

Text on disabled controls.

public static NSColor DisabledControlText { get; }

Property Value

NSColor

Gray

Gray.

public static NSColor Gray { get; }

Property Value

NSColor

Grayscale

Get grayscale and alpha of color.

public (double, double) Grayscale { get; }

Property Value

(double, double)

Green

Green.

public static NSColor Green { get; }

Property Value

NSColor

GreenComponent

Get green component.

public double GreenComponent { get; }

Property Value

double

Grid

Grids in controls.

public static NSColor Grid { get; }

Property Value

NSColor

HSI

Get hue, saturation, intensity (brightness) and alpha of color.

public (double, double, double, double) HSI { get; }

Property Value

(double, double, double, double)

Header

Background color for header cells in Table/OutlineView.

public static NSColor Header { get; }

Property Value

NSColor

HeaderText

Text color for header cells in Table/OutlineView.

public static NSColor HeaderText { get; }

Property Value

NSColor

Highlight

Highlight color for UI elements.

public static NSColor Highlight { get; }

Property Value

NSColor

IsCMYK

Check whether the color model is CMYK or not.

public bool IsCMYK { get; }

Property Value

bool

IsDynamic

Check whether the color object represents a dynamic color or not.

public bool IsDynamic { get; }

Property Value

bool

IsGrayscale

Check whether the color model is Gray or not.

public bool IsGrayscale { get; }

Property Value

bool

IsIndexed

Check whether the color model is Indexed or not.

public bool IsIndexed { get; }

Property Value

bool

IsPatterned

Check whether the color patterned color or not.

public bool IsPatterned { get; }

Property Value

bool

IsRGB

Check whether the color model is RGB or not.

public bool IsRGB { get; }

Property Value

bool

KeyboardFocusIndicator

Keyboard focus ring around controls.

public static NSColor KeyboardFocusIndicator { get; }

Property Value

NSColor

Knob

Knob face color for controls.

public static NSColor Knob { get; }

Property Value

NSColor

Label

Text color for static text and related elements.

public static NSColor Label { get; }

Property Value

NSColor

LightGray

Light gray.

public static NSColor LightGray { get; }

Property Value

NSColor

Magenta

Magenta.

public static NSColor Magenta { get; }

Property Value

NSColor

Orange

Orange.

public static NSColor Orange { get; }

Property Value

NSColor

Purple

Purple.

public static NSColor Purple { get; }

Property Value

NSColor

QuaternaryLabel

Text color for large secondary or disabled static text, separators, large glyphs/icons, etc

public static NSColor QuaternaryLabel { get; }

Property Value

NSColor

RGBA

Get RGBA components.

public (double, double, double, double) RGBA { get; }

Property Value

(double, double, double, double)

Red

Red.

public static NSColor Red { get; }

Property Value

NSColor

RedComponent

Get red component.

public double RedComponent { get; }

Property Value

double

ScrollBar

Scroll bar slot color.

public static NSColor ScrollBar { get; }

Property Value

NSColor

ScrubberTexturedBackground

Similar to SelectedControlColor.

public static NSColor ScrubberTexturedBackground { get; }

Property Value

NSColor

SecondaryLabel

Patterned background color for use in NSScrubber.

public static NSColor SecondaryLabel { get; }

Property Value

NSColor

SecondarySelectedControl

Color for selected controls when control is not active.

public static NSColor SecondarySelectedControl { get; }

Property Value

NSColor

SelectedControl

Control face for selected controls.

public static NSColor SelectedControl { get; }

Property Value

NSColor

SelectedControlText

Text on selected controls.

public static NSColor SelectedControlText { get; }

Property Value

NSColor

SelectedKnob

Knob face color for selected controls.

public static NSColor SelectedKnob { get; }

Property Value

NSColor

SelectedMenuItem

Highlight color for menus.

public static NSColor SelectedMenuItem { get; }

Property Value

NSColor

SelectedMenuItemText

Highlight color for menu text.

public static NSColor SelectedMenuItemText { get; }

Property Value

NSColor

SelectedText

Selected document text.

public static NSColor SelectedText { get; }

Property Value

NSColor

SelectedTextBackground

Selected document text background.

public static NSColor SelectedTextBackground { get; }

Property Value

NSColor

Shadow

Shadow color for UI elements.

public static NSColor Shadow { get; }

Property Value

NSColor

TertiaryLabel

Text color for disabled static text and related elements.

public static NSColor TertiaryLabel { get; }

Property Value

NSColor

Text

Document text.

public static NSColor Text { get; }

Property Value

NSColor

TextBackground

Document text background.

public static NSColor TextBackground { get; }

Property Value

NSColor

Type

Get type of color.

public NSColor.ColorType Type { get; }

Property Value

NSColor.ColorType

UnderPageBackground

Background areas revealed behind views.

public static NSColor UnderPageBackground { get; }

Property Value

NSColor

White

White.

public static NSColor White { get; }

Property Value

NSColor

WindowBackground

Background fill for window contents.

public static NSColor WindowBackground { get; }

Property Value

NSColor

WindowFrame

Window frames.

public static NSColor WindowFrame { get; }

Property Value

NSColor

WindowFrameText

Text on window frames.

public static NSColor WindowFrameText { get; }

Property Value

NSColor

Yellow

Yellow.

public static NSColor Yellow { get; }

Property Value

NSColor

Methods

BlendWith(double, NSColor)

Creates a new color object whose component values are a weighted sum of the current color object and the specified color object's.

public NSColor? BlendWith(double fraction, NSColor color)

Parameters

fraction double

The amount of the color to blend with this color.

color NSColor

The color to blend with this color.

Returns

NSColor

Blended color, or Null if the colors can’t be converted.

Create(NSColorSpace, params double[])

Create color object.

public static NSColor Create(NSColorSpace colorSpace, params double[] components)

Parameters

colorSpace NSColorSpace

Color space

components double[]

Color components.

Returns

NSColor

Color.

CreateHSI(NSColorSpace, double, double, double, double)

Create RGBA color object from HSI components.

public static NSColor CreateHSI(NSColorSpace colorSpace, double h, double s, double i, double a = 1)

Parameters

colorSpace NSColorSpace

Color space.

h double

Hue.

s double

Saturation.

i double

Intensity (Brightness).

a double

Alpha.

Returns

NSColor

Color.

CreateRGBA(NSColorSpace, double, double, double, double)

Create RGBA color object.

public static NSColor CreateRGBA(NSColorSpace colorSpace, double r, double g, double b, double a = 1)

Parameters

colorSpace NSColorSpace

Color space.

r double

Red.

g double

Green.

b double

Blue.

a double

Alpha.

Returns

NSColor

Color.

CreateWithDisplayP3(double, double, double, double)

Create Display-P3 color object.

public static NSColor CreateWithDisplayP3(double r, double g, double b, double a = 1)

Parameters

r double

Red.

g double

Green.

b double

Blue.

a double

Alpha.

Returns

NSColor

Color.

CreateWithSRGB(double, double, double, double)

Create sRGB color object.

public static NSColor CreateWithSRGB(double r, double g, double b, double a = 1)

Parameters

r double

Red.

g double

Green.

b double

Blue.

a double

Alpha.

Returns

NSColor

Color.

HighlightWith(double)

Creates a new color object that represents a blend between the current color and the highlight color.

public NSColor? HighlightWith(double level)

Parameters

level double

The level, range is [0.0, 1.0].

Returns

NSColor

Color object, or Null if the colors can’t be converted.

ShadowWith(double)

Creates a new color object that represents a blend between the current color and the shadow color.

public NSColor? ShadowWith(double level)

Parameters

level double

The level, range is [0.0, 1.0].

Returns

NSColor

Color object, or Null if the colors can’t be converted.

ToString()

Returns a string that represents the current object.

public override string ToString()

Returns

string

A string that represents the current object.

UseColorSpace(NSColorSpace)

Create a new color object representing the color of the current color object in the specified color space.

public NSColor? UseColorSpace(NSColorSpace colorSpace)

Parameters

colorSpace NSColorSpace

Color space.

Returns

NSColor

Color object with color space, or Null if conversion is not possible.

UseType(ColorType)

Return a version of the color object that is compatible with the specified color type.

public NSColor? UseType(NSColor.ColorType type)

Parameters

type NSColor.ColorType

Color type.

Returns

NSColor

A compatible color object, or Null if a compatible color object is not available.

WithAlphaComponent(double)

Creates a new color object that has the same color space and component values as the current color object, but the specified alpha component.

public NSColor WithAlphaComponent(double alpha)

Parameters

alpha double

Alpha component.

Returns

NSColor

Color.