Color
Color represents any color used across the DOM. Construct from hex, RGB, ARGB, named colors, theme colors, or system colors, and apply tint/shade/complement transforms.
Hex, RGB, ARGB
Use case: Create colors from different numeric representations.
C#
1using Vega.DOM;
2
3var hex = new Color("#FF5733");
4var rgb = new Color(255, 87, 51);
5var argb = new Color(180, 255, 87, 51); // 30% transparent
Theme Colors with Tint/Shade
Use case: Stay consistent with the document theme.
C#
1var accent = Color.ThemeColor(ThemeColorValues.Accent1, ThemeTint: new Percentage(10));
2accent.Tint = new Percentage(20);
3accent.Shade = new Percentage(10);
Apply Color to a TextStyle
Use case: Set both text and background colors.
C#
1var style = new TextStyle
2{
3 Font = new Font { Color = new Color("#1E88E5") },
4 BackgroundColor = new Color(255, 255, 200),
5};
Related API
Frequently asked questions
What's the difference between a theme color and a preset color?
Theme colors adapt to the document's active theme; preset colors are fixed (e.g. Color.Red).
Can I use transparency in colors?
Yes — the ARGB constructor accepts an alpha byte (0–255).