Color
Overview
Color is a class in Aspose.PDF FOSS for .NET.
Represents a color value used in PDF documents.
This class declares 14 methods for Color objects in .NET programs.
Available methods include: Color, Equals, FromArgb, FromCmyk, FromGray, FromRgb, GetHashCode, Parse, ToRgb, ToRgbArray, ToString.
Public members are accessible to any .NET application after installing the Aspose.PDF FOSS for .NET package.
Properties: A, AByte, AliceBlue, AntiqueWhite, Aqua, Aquamarine, and 146 more.
Properties
| Name | Type | Access | Description |
|---|---|---|---|
R | byte | Read | RGB components in 0–255 range. |
G | byte | Read | Gets the green component (0-255). |
B | byte | Read | Gets the blue component (0-255). |
AByte | byte | Read | Byte-typed alpha (0–255). |
A | double | Read | Alpha in 0..1 range (public surface). |
IsEmpty | bool | Read | Whether this color has been set (non-empty). |
Data | double[]? | Read | The colour-space component values: one entry for DeviceGray, three for DeviceRGB. |
PatternColorSpace | Aspose.Pdf.Drawing.PatternColorSpace? | Read/Write | The pattern color space (for advanced use). |
ColorSpace | Aspose.Pdf.ColorSpace | Read | Top-level Aspose.Pdf.ColorSpace selector. |
ColorType | ColorType | Read/Write | FOSS-internal colour-space marker (ColorType.Rgb / Cmyk / Gray). |
Transparent | Color | Read | Gets a fully transparent colour (alpha 0, RGB 255, 255, 255). |
AliceBlue | Color | Read | Gets the alice blue. |
AntiqueWhite | Color | Read | Gets the opaque AntiqueWhite colour (RGB 250, 235, 215). |
Aqua | Color | Read | Gets the opaque Aqua colour (RGB 0, 255, 255). |
Aquamarine | Color | Read | Gets the aquamarine. |
Azure | Color | Read | Gets the opaque Azure colour (RGB 240, 255, 255). |
Beige | Color | Read | Gets the opaque Beige colour (RGB 245, 245, 220). |
Bisque | Color | Read | Gets the bisque. |
Black | Color | Read | Gets the opaque Black colour (RGB 0, 0, 0). |
BlanchedAlmond | Color | Read | Gets the blanched almond. |
Blue | Color | Read | Gets the opaque Blue colour (RGB 0, 0, 255). |
BlueViolet | Color | Read | Gets the opaque BlueViolet colour (RGB 138, 43, 226). |
Brown | Color | Read | Gets the brown. |
BurlyWood | Color | Read | Gets the burly wood. |
CadetBlue | Color | Read | Gets the cadet blue. |
Chartreuse | Color | Read | Gets the chartreuse. |
Chocolate | Color | Read | Gets the chocolate. |
Coral | Color | Read | Gets the coral. |
CornflowerBlue | Color | Read | Gets the cornflower blue. |
Cornsilk | Color | Read | Gets the cornsilk. |
Crimson | Color | Read | Gets the crimson. |
Cyan | Color | Read | Gets the opaque Cyan colour (RGB 0, 255, 255). |
DarkBlue | Color | Read | Gets the opaque DarkBlue colour (RGB 0, 0, 139). |
DarkCyan | Color | Read | Gets the opaque DarkCyan colour (RGB 0, 139, 139). |
DarkGoldenrod | Color | Read | Gets the dark goldenrod. |
DarkGray | Color | Read | Gets the opaque DarkGray colour (RGB 169, 169, 169). |
DarkGreen | Color | Read | Gets the opaque DarkGreen colour (RGB 0, 100, 0). |
DarkKhaki | Color | Read | Gets the opaque DarkKhaki colour (RGB 189, 183, 107). |
DarkMagenta | Color | Read | Gets the opaque DarkMagenta colour (RGB 139, 0, 139). |
DarkOliveGreen | Color | Read | Gets the dark olive green. |
DarkOrange | Color | Read | Gets the dark orange. |
DarkOrchid | Color | Read | Gets the dark orchid. |
DarkRed | Color | Read | Gets the opaque DarkRed colour (RGB 139, 0, 0). |
DarkSalmon | Color | Read | Gets the dark salmon. |
DarkSeaGreen | Color | Read | Gets the dark sea green. |
DarkSlateBlue | Color | Read | Gets the dark slate blue. |
DarkSlateGray | Color | Read | Gets the opaque DarkSlateGray colour (RGB 47, 79, 79). |
DarkTurquoise | Color | Read | Gets the dark turquoise. |
DarkViolet | Color | Read | Gets the dark violet. |
DeepPink | Color | Read | Gets the deep pink. |
DeepSkyBlue | Color | Read | Gets the deep sky blue. |
DimGray | Color | Read | Gets the dim gray. |
DodgerBlue | Color | Read | Gets the dodger blue. |
Firebrick | Color | Read | Gets the firebrick. |
FloralWhite | Color | Read | Gets the floral white. |
ForestGreen | Color | Read | Gets the forest green. |
Fuchsia | Color | Read | Gets the fuchsia. |
Gainsboro | Color | Read | Gets the gainsboro. |
GhostWhite | Color | Read | Gets the ghost white. |
Gold | Color | Read | Gets the gold. |
Goldenrod | Color | Read | Gets the goldenrod. |
Gray | Color | Read | Gets the opaque Gray colour (RGB 128, 128, 128). |
Green | Color | Read | Gets the opaque Green colour (RGB 0, 128, 0). |
GreenYellow | Color | Read | Gets the opaque GreenYellow colour (RGB 173, 255, 47). |
Honeydew | Color | Read | Gets the honeydew. |
HotPink | Color | Read | Gets the hot pink. |
IndianRed | Color | Read | Gets the indian red. |
Indigo | Color | Read | Gets the indigo. |
Ivory | Color | Read | Gets the ivory. |
Khaki | Color | Read | Gets the khaki. |
Lavender | Color | Read | Gets the lavender. |
LavenderBlush | Color | Read | Gets the lavender blush. |
LawnGreen | Color | Read | Gets the lawn green. |
LemonChiffon | Color | Read | Gets the lemon chiffon. |
LightBlue | Color | Read | Gets the opaque LightBlue colour (RGB 173, 216, 230). |
LightCoral | Color | Read | Gets the opaque LightCoral colour (RGB 240, 128, 128). |
LightCyan | Color | Read | Gets the light cyan. |
LightGoldenrodYellow | Color | Read | Gets the opaque LightGoldenrodYellow colour (RGB 250, 250, 210). |
LightGray | Color | Read | Gets the opaque LightGray colour (RGB 211, 211, 211). |
LightGreen | Color | Read | Gets the opaque LightGreen colour (RGB 144, 238, 144). |
LightPink | Color | Read | Gets the light pink. |
LightSalmon | Color | Read | Gets the light salmon. |
LightSeaGreen | Color | Read | Gets the opaque LightSeaGreen colour (RGB 32, 178, 170). |
LightSkyBlue | Color | Read | Gets the light sky blue. |
LightSlateGray | Color | Read | Gets the light slate gray. |
LightSteelBlue | Color | Read | Gets the light steel blue. |
LightYellow | Color | Read | Gets the opaque LightYellow colour (RGB 255, 255, 224). |
Lime | Color | Read | Gets the lime. |
LimeGreen | Color | Read | Gets the lime green. |
Linen | Color | Read | Gets the linen. |
Magenta | Color | Read | Gets the opaque Magenta colour (RGB 255, 0, 255). |
Maroon | Color | Read | Gets the opaque Maroon colour (RGB 128, 0, 0). |
MediumAquamarine | Color | Read | Gets the medium aquamarine. |
MediumBlue | Color | Read | Gets the medium blue. |
MediumOrchid | Color | Read | Gets the medium orchid. |
MediumPurple | Color | Read | Gets the medium purple. |
MediumSeaGreen | Color | Read | Gets the medium sea green. |
MediumSlateBlue | Color | Read | Gets the medium slate blue. |
MediumSpringGreen | Color | Read | Gets the medium spring green. |
MediumTurquoise | Color | Read | Gets the medium turquoise. |
MediumVioletRed | Color | Read | Gets the medium violet red. |
MidnightBlue | Color | Read | Gets the midnight blue. |
MintCream | Color | Read | Gets the mint cream. |
MistyRose | Color | Read | Gets the opaque MistyRose colour (RGB 255, 228, 225). |
Moccasin | Color | Read | Gets the moccasin. |
NavajoWhite | Color | Read | Gets the navajo white. |
Navy | Color | Read | Gets the opaque Navy colour (RGB 0, 0, 128). |
OldLace | Color | Read | Gets the old lace. |
Olive | Color | Read | Gets the olive. |
OliveDrab | Color | Read | Gets the olive drab. |
Orange | Color | Read | Gets the orange. |
OrangeRed | Color | Read | Gets the orange red. |
Orchid | Color | Read | Gets the orchid. |
PaleGoldenrod | Color | Read | Gets the pale goldenrod. |
PaleGreen | Color | Read | Gets the pale green. |
PaleTurquoise | Color | Read | Gets the pale turquoise. |
PaleVioletRed | Color | Read | Gets the pale violet red. |
PapayaWhip | Color | Read | Gets the papaya whip. |
PeachPuff | Color | Read | Gets the peach puff. |
Peru | Color | Read | Gets the peru. |
Pink | Color | Read | Gets the pink. |
Plum | Color | Read | Gets the plum. |
PowderBlue | Color | Read | Gets the powder blue. |
Purple | Color | Read | Gets the purple. |
Red | Color | Read | Gets the opaque Red colour (RGB 255, 0, 0). |
RosyBrown | Color | Read | Gets the rosy brown. |
RoyalBlue | Color | Read | Gets the royal blue. |
SaddleBrown | Color | Read | Gets the saddle brown. |
Salmon | Color | Read | Gets the salmon. |
SandyBrown | Color | Read | Gets the sandy brown. |
SeaGreen | Color | Read | Gets the sea green. |
SeaShell | Color | Read | Gets the sea shell. |
Sienna | Color | Read | Gets the sienna. |
Silver | Color | Read | Gets the silver. |
SkyBlue | Color | Read | Gets the sky blue. |
SlateBlue | Color | Read | Gets the slate blue. |
SlateGray | Color | Read | Gets the slate gray. |
Snow | Color | Read | Gets the snow. |
SpringGreen | Color | Read | Gets the spring green. |
SteelBlue | Color | Read | Gets the steel blue. |
Tan | Color | Read | Gets the tan. |
Teal | Color | Read | Gets the teal. |
Thistle | Color | Read | Gets the thistle. |
Tomato | Color | Read | Gets the opaque Tomato colour (RGB 255, 99, 71). |
Turquoise | Color | Read | Gets the turquoise. |
Violet | Color | Read | Gets the opaque Violet colour (RGB 238, 130, 238). |
Wheat | Color | Read | Gets the wheat. |
White | Color | Read | Gets the opaque White colour (RGB 255, 255, 255). |
WhiteSmoke | Color | Read | Gets the opaque WhiteSmoke colour (RGB 245, 245, 245). |
Yellow | Color | Read | Gets the opaque Yellow colour (RGB 255, 255, 0). |
YellowGreen | Color | Read | Gets the yellow green. |
Empty | Color | Read | Gets the empty. |
Methods
| Signature | Description |
|---|---|
Color() | Creates an empty (transparent black) color. |
Color(components: double[]) | Create a colour from raw colour-space components (one entry = DeviceGray, three = DeviceRGB), keeping the exact component values in Data — the shape a 3D view’s /BG colour array carries. |
Equals(obj: object?) | Calls Equals(obj) on this Color instance. |
GetHashCode() | Calls GetHashCode on this Color instance. |
FromArgb(r: int, g: int, b: int) | Creates an opaque colour from red, green and blue components in the range 0-255. |
FromArgb(a: int, r: int, g: int, b: int) | Creates a colour from alpha, red, green and blue components in the range 0-255 (alpha 0 is fully transparent). |
FromRgb(r: double, g: double, b: double) | Creates an opaque colour from red, green and blue components in the range 0.0-1.0; each is rounded to an 8-bit channel. |
FromRgb(color: System.Drawing.Color) | Creates a colour from a System.Drawing.Color, keeping its alpha, red, green and blue values. |
FromCmyk(c: double, m: double, y: double, k: double) | Calls FromCmyk(c, m, y, k) on this Color instance. |
FromGray(g: double) | Calls FromGray(g) on this Color instance. |
Parse(value: string) | Parses a hex colour string: RRGGBB (opaque) or AARRGGBB, with or without a leading #. |
ToRgbArray() | Convert to PDF color array [r, g, b] in 0–1 range. |
ToRgb() | Calls ToRgb on this Color instance. |
ToString() | Calls ToString on this Color instance. |