Color
Overview
Color is a class in Aspose.Pdf FOSS for Java.
Represents a color value in one of several color spaces (RGB, Grayscale, CMYK).
Properties
| Name | Type | Access | Description |
|---|---|---|---|
black | Color | Read | Returns the predefined black color. |
white | Color | Read | Returns the predefined white color. |
red | Color | Read | Returns the predefined red color. |
green | Color | Read | Returns the predefined green color. |
blue | Color | Read | Returns the predefined blue color. |
yellow | Color | Read | Returns the predefined yellow color. |
gray | Color | Read | Returns the predefined gray color. |
lightGray | Color | Read | Returns the predefined light gray color. |
transparent | Color | Read | Returns the predefined transparent color. |
alpha | double | Read | Returns the alpha (opacity) component of this color. |
colorSpace | ColorSpace | Read | Returns the color space of this color. |
components | double[] | Read | Returns a copy of the component values. |
r | double | Read | Returns the red component (0..1) for RGB colors, or an approximation for others. |
g | double | Read | Returns the green component (0..1) for RGB colors, or an approximation for others. |
b | double | Read | Returns the blue component (0..1) for RGB colors, or an approximation for others. |
BLACK | Color | Read | Black (gray 0). |
WHITE | Color | Read | White (gray 1). |
RED | Color | Read | Red (RGB 1, 0, 0). |
GREEN | Color | Read | Green (RGB 0, 1, 0). |
BLUE | Color | Read | Blue (RGB 0, 0, 1). |
YELLOW | Color | Read | Yellow (RGB 1, 1, 0). |
GRAY | Color | Read | Gray (RGB 0.5, 0.5, 0.5). |
BLUE_VIOLET | Color | Read | Blue-violet (RGB 138, 43, 226). |
TRANSPARENT | Color | Read | Fully transparent color (alpha = 0). |
LIGHT_GRAY | Color | Read | Light gray color. |
Methods
| Signature | Description |
|---|---|
getBlack() → Color | Returns the predefined black color. |
getWhite() → Color | Returns the predefined white color. |
getRed() → Color | Returns the predefined red color. |
getGreen() → Color | Returns the predefined green color. |
getBlue() → Color | Returns the predefined blue color. |
getYellow() → Color | Returns the predefined yellow color. |
getGray() → Color | Returns the predefined gray color. |
getLightGray() → Color | Returns the predefined light gray color. |
getTransparent() → Color | Returns the predefined transparent color. |
fromRgb(r: double, g: double, b: double) → Color | Creates an RGB color. |
fromGray(gray: double) → Color | Creates a grayscale color. |
fromCmyk(c: double, m: double, y: double, k: double) → Color | Creates a CMYK color. |
fromArgb(red: int, green: int, blue: int) → Color | Creates an RGB color from integer component values in the 0-255 range. |
fromArgb(alpha: int, red: int, green: int, blue: int) → Color | Creates an RGB color with alpha from integer component values in the 0-255 range. |
fromHtml(htmlColor: String) → Color | Parses an HTML hex color string into a Color. |
getAlpha() → double | Returns the alpha (opacity) component of this color. |
getColorSpace() → ColorSpace | Returns the color space of this color. |
getComponents() → double[] | Returns a copy of the component values. |
getR() → double | Returns the red component (0..1) for RGB colors, or an approximation for others. |
getG() → double | Returns the green component (0..1) for RGB colors, or an approximation for others. |
getB() → double | Returns the blue component (0..1) for RGB colors, or an approximation for others. |
equals(o: Object) → boolean | |
hashCode() → int | |
toString() → String |