ColorProtocol
public protocol ColorProtocol
The PangoColor structure is used to
represent a color in an uncalibrated RGB color-space.
The ColorProtocol protocol exposes the methods and properties of an underlying PangoColor instance.
The default implementation of these can be found in the protocol extension below.
For a concrete class that implements these methods and properties, see Color.
Alternatively, use ColorRef as a lighweight, unowned reference if you already have an instance you just want to use.
-
Untyped pointer to the underlying
PangoColorinstance.Declaration
Swift
var ptr: UnsafeMutableRawPointer! { get } -
color_ptrDefault implementationTyped pointer to the underlying
PangoColorinstance.Default Implementation
Return the stored, untyped pointer as a typed pointer to the
PangoColorinstance.Declaration
Swift
var color_ptr: UnsafeMutablePointer<PangoColor>! { get } -
Required Initialiser for types conforming to
ColorProtocolDeclaration
Swift
init(raw: UnsafeMutableRawPointer)
-
copy()Extension methodCreates a copy of
src.The copy should be freed with [method
Pango.Color.free]. Primarily used by language bindings, not that useful otherwise (since colors can just be copied by assignment in C).Declaration
Swift
@inlinable func copy() -> Pango.ColorRef! -
free()Extension methodFrees a color allocated by [method
Pango.Color.copy].Declaration
Swift
@inlinable func free() -
parse(spec:Extension method) Fill in the fields of a color from a string specification.
The string can either one of a large set of standard names. (Taken from the CSS Color specification, or it can be a value in the form
rgb,rrggbb,rrrgggbbborrrrrggggbbbb, wherer,gandbare hex digits of the red, green, and blue components of the color, respectively. (White in the four forms isfff,ffffff,fffffffffandffffffffffff.)Declaration
Swift
@inlinable func parse(spec: UnsafePointer<CChar>!) -> Bool -
parseWith(alpha:Extension methodspec: ) Fill in the fields of a color from a string specification.
The string can either one of a large set of standard names. (Taken from the CSS Color specification, or it can be a hexadecimal value in the form
rgb,rrggbb,rrrgggbbborrrrrggggbbbbwherer,gandbare hex digits of the red, green, and blue components of the color, respectively. (White in the four forms isfff,ffffff,fffffffffandffffffffffff.)Additionally, parse strings of the form
rgba,rrggbbaa,rrrrggggbbbbaaaa, ifalphais notnil, and setalphato the value specified by the hex digits fora. If no alpha component is found inspec,alphais set to 0xffff (for a solid color).Declaration
Swift
@inlinable func parseWith(alpha: UnsafeMutablePointer<guint16>! = nil, spec: UnsafePointer<CChar>!) -> Bool -
toString()Extension methodReturns a textual specification of
color.The string is in the hexadecimal form
rrrrggggbbbb, wherer,gandbare hex digits representing the red, green, and blue components respectively.Declaration
Swift
@inlinable func toString() -> String! -
redExtension methodvalue of red component
Declaration
Swift
@inlinable var red: guint16 { get set } -
greenExtension methodvalue of green component
Declaration
Swift
@inlinable var green: guint16 { get set } -
blueExtension methodvalue of blue component
Declaration
Swift
@inlinable var blue: guint16 { get set }
View on GitHub
Install in Dash
ColorProtocol Protocol Reference