VegaRise.NET
Back to DOM

ColorFieldClass

Definition

Namespace
DOM.Elements.Graphics.Colors
Assembly
DOM.dll

Represents a single color channel value (alpha, red, green, or blue) that can be used as an RGBA component of a . Color

Remarks

is a lightweight wrapper around a single (0–255) that is used for the A, R, G, and B properties of . It derives from so it also supports optional modulation and offset modifiers. ColorField Byte Color BaseColorField An implicit conversion from is provided so that channel values can be assigned directly from a byte literal. Byte

Examples

csharp
1// 1. Create a channel from a byte
2var red = new ColorField { Value = 255 };
3
csharp
1// 2. Use the implicit conversion
2ColorField green = 128;
3
csharp
1// 3. Assign a channel on a color
2var c = new Color();
3c.R = (byte)255;
4c.G = (byte)128;
5c.B = (byte)0;
6
csharp
1// 4. Modulate a channel with a percentage
2var c = new ColorField { Value = 200, Modulation = new Percentage(20) };
3

Properties

Valuebyte

Gets or sets the channel value.

Methods

Implicitly converts a to a . Byte, ColorField

VegaRise.NET

Sign In

Welcome back. Please sign in to your account.

Forgot password?
or

Don't have an account? Create an account

By signing in, you agree to our Terms of Service and Privacy Policy.