Color
classin packageklyn.gui.windows
public class Color:
RGBA color used by `Painter`, `Pen` and `Brush`.
accent = Color(37, 99, 235, 1.0)
print(accent.toCssColor())
Properties
| Modifier and Type |
Member |
Description |
| public property |
alpha |
Alpha channel in `[0. |
| public property |
blue |
Blue channel in `[0, 255]`. |
| public property |
green |
Green channel in `[0, 255]`. |
| public property |
red |
Red channel in `[0, 255]`. |
Constructors
| Modifier and Type |
Member |
Description |
| public |
Color |
No summary. |
Methods
| Modifier and Type |
Member |
Description |
| public static |
black |
Returns an opaque black color. |
| public |
clone |
Creates a copy of the color. |
| public |
darker |
Returns a darker variant of this color. |
| public static |
fromHex |
Parses a `#RRGGBB` or `#RRGGBBAA` color literal. |
| public |
lighter |
Returns a lighter variant of this color. |
| public |
mix |
Mixes this color with another one. |
| public static |
parse |
Parses a CSS-like color value. |
| public |
toCssColor |
Serializes the color into a CSS-compatible `rgba(. |
| public override |
toString |
No summary. |
| public static |
transparent |
Returns a fully transparent black color. |
| public static |
white |
Returns an opaque white color. |
| public |
withAlpha |
Returns the same RGB color with another alpha channel. |