iOS Guides | Samples

MonoTouch.UIKit.UIColor Class

Colors and Patterns as used in MonoTouch.UIKit.

See Also: UIColor

Syntax

[MonoTouch.Foundation.Register("UIColor", true)]
public class UIColor : NSObject, INSCopying, INSSecureCoding, IDisposable

Remarks

Basic representation for colors in UIKit. UIColors can be created from various color representations as well as encoding an alpha transparency channel. In addition to solid or transparent colors, it is possible to create a UIColor instance from an image, and use the resulting UIColor as a brush whenever a UIKit UIColor is used.

In addition to providing various constructors and some common colors, the following colors represent system colors: UIColor.LightTextColor, UIColor.DarkTextColor, UIColor.GroupTableViewBackgroundColor, UIColor.ViewFlipsideBackgroundColor, UIColor.ScrollViewTexturedBackgroundColor and UIColor.UnderPageBackgroundColor.

The members of this class can be used from a background thread.

Related content

Requirements

Namespace: MonoTouch.UIKit
Assembly: monotouch (in monotouch.dll)
Assembly Versions: 0.0.0.0

The members of MonoTouch.UIKit.UIColor are listed below.

See Also: NSObject

Public Constructors

Creates a new UIColor from the specified CGColor.
Creates a new UIColor from the specified CIColor.
A constructor that initializes the object from the data stored in the unarchiver object.
Constructor to call on derived classes to skip initialization and merely allocate the object.
Creates a new "color" that fills its area with the provide pattern image.
A constructor used when creating managed representations of unmanaged objects; Called by the runtime.
Creates a new color with the grayscale value in white and the opacity value in alpha.
UIColor constructor from red, green, blue and alpha components.

Public Properties

[read-only]
static
BlackUIColor. A color with grayscale 0.0 and alpha 1.0.
[read-only]
static
BlueUIColor. A color with RGBA of (0,0,1,1).
[read-only]
static
BrownUIColor. A color with RGBA of (0.6, 0.4, 0.2, 1.0).
[read-only]
CGColorCGColor. Returns the CoreGraphics CGColor for this UIColor.
[read-only]
CIColorCIColor. Gets a CIColor representation of the color.
[read-only]
override
ClassHandleIntPtr. The handle for this class.
[read-only]
static
ClearUIColor. A color with grayscale 0 and alpha 0.
[read-only]
static
CyanUIColor. A color with RGBA of (0, 1, 1, 1).
[read-only]
static
DarkGrayUIColor. A color with grayscale 1/3 and alpha 1.
[read-only]
static
DarkTextColorUIColor. The system color for displaying text on a light background.
[read-only]
static
GrayUIColor. A color object with grayscale 0.5 and alpha 1.0.
[read-only]
static
GreenUIColor. A color with RGBA of (0,1,0,1).
[read-only]
static
GroupTableViewBackgroundColorUIColor. The operating system color used for the background in groupped UITableViews.
[read-only]
static
LightGrayUIColor. A color with grayscale 2/3 and alpha 1.
[read-only]
static
LightTextColorUIColor. The operating system color used for displaying text on a dark background.
[read-only]
static
MagentaUIColor. A color with RGBA of (1,0,1,1).
[read-only]
static
OrangeUIColor. A color with RGBA of (1.0, 0.5, 0.0, 1.0).
[read-only]
static
PurpleUIColor. A color with RGBA of (0.5, 0.0, 0.5, 1.0).
[read-only]
static
RedUIColor. A color with RGBA of (1,0,0,1).
[read-only]
static
ScrollViewTexturedBackgroundColorUIColor. Developers should not use this deprecated property, that renders the area behind scrollable content.
[read-only]
static
UnderPageBackgroundColorUIColor. Developers should not use this deprecated method, indicating the color used to render the background of a page.
[read-only]
static
ViewFlipsideBackgroundColorUIColor. Developers should not use this deprecated property, that specifies the back of pages during a flip transition.
[read-only]
static
WhiteUIColor. A color with grayscale 1 and alpha 1.
[read-only]
static
YellowUIColor. A color with RGBA of (1, 1, 0, 1).

Public Methods

ColorWithAlpha(Single) : UIColor
Creates a new color with the specified alpha channel from a reference color.
Copy(NSZone) : NSObject
Performs a copy of the underlying Objective-C object.
static
FromCGColor(CGColor) : UIColor
Creates a UIColor based on the Core Graphics Quartz color reference.
static
FromCIColor(CIColor) : UIColor
Creates a UIColor from a CoreImage CIColor.
static
FromDisplayP3(Single, Single, Single, Single) : UIColor
Creates a new color from the specified values in the P3 color space.
static
FromHSB(Single, Single, Single) : UIColor
Creates a color from using the hue, saturation and brightness components.
static
FromHSBA(Single, Single, Single, Single) : UIColor
Creates a color from using the hue, saturation, brightness and alpha components.
static
FromPatternImage(UIImage) : UIColor
Creates a UIColor based on an image, the color can then be used as a brush to paint with the image.
static
FromRGB(Byte, Byte, Byte) : UIColor
Creates a solid color using the red, green and blue components specified.
static
FromRGB(Int32, Int32, Int32) : UIColor
Creates a color from the specified combinated of red, green, and blue components.
static
FromRGB(Single, Single, Single) : UIColor
Creates a solid color using the red, green and blue components specified.
static
FromRGBA(Byte, Byte, Byte, Byte) : UIColor
Creates a color with the specified alpha transparency using the red, green and blue components specified.
static
FromRGBA(Int32, Int32, Int32, Int32) : UIColor
Creates a color from the specified combination of red, green, and blue elements, with the specified transparency.
static
FromRGBA(Single, Single, Single, Single) : UIColor
Creates a color with the specified alpha transparency using the red, green and blue components specified.
static
FromWhiteAlpha(Single, Single) : UIColor
Creates a grayscale color, based on the current colorspace.
GetHSBA(out Single, out Single, out Single, out Single)
Returns the hue, saturation, brightness and alpha components of the color.
GetRGBA(out Single, out Single, out Single, out Single)
Returns the red, green, blue and alpha components of this color.
GetWhite(out Single, out Single) : Boolean
The grayscale components of the color.
SetColor()
Sets both the fill and stroke color for drawing.
SetFill()
Sets the fill color for drawing.
SetStroke()
Sets the stroke color for drawing.
override
ToString() : String
Returns a string representation of the value of the current instance.