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
AlternateSelectedControl
Similar to SelectedControlColor.
public static NSColor AlternateSelectedControl { get; }
Property Value
AlternateSelectedControlText
Similar to SelectedControlTextColor.
public static NSColor AlternateSelectedControlText { get; }
Property Value
Black
Black.
public static NSColor Black { get; }
Property Value
Blue
Blue.
public static NSColor Blue { get; }
Property Value
BlueComponent
Get blue component.
public double BlueComponent { get; }
Property Value
Brown
Brown.
public static NSColor Brown { get; }
Property Value
CMYK
Get cyan, magenta, yellow, black and alpha of color.
public (double, double, double, double, double) CMYK { get; }
Property Value
Clear
Transparent.
public static NSColor Clear { get; }
Property Value
ColorSpace
Get color space.
public NSColorSpace? ColorSpace { get; }
Property Value
Control
Control face and old window background color.
public static NSColor Control { get; }
Property Value
ControlBackground
Background of large controls.
public static NSColor ControlBackground { get; }
Property Value
ControlDarkShadow
Darker border for controls.
public static NSColor ControlDarkShadow { get; }
Property Value
ControlHighlight
Light border for controls.
public static NSColor ControlHighlight { get; }
Property Value
ControlLightHighlight
Lighter border for controls.
public static NSColor ControlLightHighlight { get; }
Property Value
ControlShadow
Dark border for controls.
public static NSColor ControlShadow { get; }
Property Value
ControlText
Text on controls.
public static NSColor ControlText { get; }
Property Value
Cyan
Cyan.
public static NSColor Cyan { get; }
Property Value
DarkGray
Dark gray.
public static NSColor DarkGray { get; }
Property Value
DisabledControlText
Text on disabled controls.
public static NSColor DisabledControlText { get; }
Property Value
Gray
Gray.
public static NSColor Gray { get; }
Property Value
Grayscale
Get grayscale and alpha of color.
public (double, double) Grayscale { get; }
Property Value
Green
Green.
public static NSColor Green { get; }
Property Value
GreenComponent
Get green component.
public double GreenComponent { get; }
Property Value
Grid
Grids in controls.
public static NSColor Grid { get; }
Property Value
HSI
Get hue, saturation, intensity (brightness) and alpha of color.
public (double, double, double, double) HSI { get; }
Property Value
Header
Background color for header cells in Table/OutlineView.
public static NSColor Header { get; }
Property Value
HeaderText
Text color for header cells in Table/OutlineView.
public static NSColor HeaderText { get; }
Property Value
Highlight
Highlight color for UI elements.
public static NSColor Highlight { get; }
Property Value
IsCMYK
Check whether the color model is CMYK or not.
public bool IsCMYK { get; }
Property Value
IsDynamic
Check whether the color object represents a dynamic color or not.
public bool IsDynamic { get; }
Property Value
IsGrayscale
Check whether the color model is Gray or not.
public bool IsGrayscale { get; }
Property Value
IsIndexed
Check whether the color model is Indexed or not.
public bool IsIndexed { get; }
Property Value
IsPatterned
Check whether the color patterned color or not.
public bool IsPatterned { get; }
Property Value
IsRGB
Check whether the color model is RGB or not.
public bool IsRGB { get; }
Property Value
KeyboardFocusIndicator
Keyboard focus ring around controls.
public static NSColor KeyboardFocusIndicator { get; }
Property Value
Knob
Knob face color for controls.
public static NSColor Knob { get; }
Property Value
Label
Text color for static text and related elements.
public static NSColor Label { get; }
Property Value
LightGray
Light gray.
public static NSColor LightGray { get; }
Property Value
Magenta
Magenta.
public static NSColor Magenta { get; }
Property Value
Orange
Orange.
public static NSColor Orange { get; }
Property Value
Purple
Purple.
public static NSColor Purple { get; }
Property Value
QuaternaryLabel
Text color for large secondary or disabled static text, separators, large glyphs/icons, etc
public static NSColor QuaternaryLabel { get; }
Property Value
RGBA
Get RGBA components.
public (double, double, double, double) RGBA { get; }
Property Value
Red
Red.
public static NSColor Red { get; }
Property Value
RedComponent
Get red component.
public double RedComponent { get; }
Property Value
ScrollBar
Scroll bar slot color.
public static NSColor ScrollBar { get; }
Property Value
ScrubberTexturedBackground
Similar to SelectedControlColor.
public static NSColor ScrubberTexturedBackground { get; }
Property Value
SecondaryLabel
Patterned background color for use in NSScrubber.
public static NSColor SecondaryLabel { get; }
Property Value
SecondarySelectedControl
Color for selected controls when control is not active.
public static NSColor SecondarySelectedControl { get; }
Property Value
SelectedControl
Control face for selected controls.
public static NSColor SelectedControl { get; }
Property Value
SelectedControlText
Text on selected controls.
public static NSColor SelectedControlText { get; }
Property Value
SelectedKnob
Knob face color for selected controls.
public static NSColor SelectedKnob { get; }
Property Value
SelectedMenuItem
Highlight color for menus.
public static NSColor SelectedMenuItem { get; }
Property Value
SelectedMenuItemText
Highlight color for menu text.
public static NSColor SelectedMenuItemText { get; }
Property Value
SelectedText
Selected document text.
public static NSColor SelectedText { get; }
Property Value
SelectedTextBackground
Selected document text background.
public static NSColor SelectedTextBackground { get; }
Property Value
Shadow
Shadow color for UI elements.
public static NSColor Shadow { get; }
Property Value
TertiaryLabel
Text color for disabled static text and related elements.
public static NSColor TertiaryLabel { get; }
Property Value
Text
Document text.
public static NSColor Text { get; }
Property Value
TextBackground
Document text background.
public static NSColor TextBackground { get; }
Property Value
Type
Get type of color.
public NSColor.ColorType Type { get; }
Property Value
UnderPageBackground
Background areas revealed behind views.
public static NSColor UnderPageBackground { get; }
Property Value
White
White.
public static NSColor White { get; }
Property Value
WindowBackground
Background fill for window contents.
public static NSColor WindowBackground { get; }
Property Value
WindowFrame
Window frames.
public static NSColor WindowFrame { get; }
Property Value
WindowFrameText
Text on window frames.
public static NSColor WindowFrameText { get; }
Property Value
Yellow
Yellow.
public static NSColor Yellow { get; }
Property Value
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
fractiondoubleThe amount of the color to blend with this color.
colorNSColorThe 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
colorSpaceNSColorSpaceColor space
componentsdouble[]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
colorSpaceNSColorSpaceColor space.
hdoubleHue.
sdoubleSaturation.
idoubleIntensity (Brightness).
adoubleAlpha.
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
colorSpaceNSColorSpaceColor space.
rdoubleRed.
gdoubleGreen.
bdoubleBlue.
adoubleAlpha.
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
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
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
leveldoubleThe 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
leveldoubleThe 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
colorSpaceNSColorSpaceColor 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
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
alphadoubleAlpha component.
Returns
- NSColor
Color.