XVColor class
Represents an 8-bit RGBA color.
This value object holds the Red, Green, Blue, and Alpha channels of a color. Channel values range from 0 to 255.
Typical use cases:
- Setting individual pixel values
- Filling image backgrounds
- Drawing annotations (lines, text, bounding boxes)
Constructors
- XVColor(int r, int g, int b, [int a = 255])
-
Creates an XVColor with Red, Green, Blue, and optional Alpha components.
const
- XVColor.fromInt(int packed)
-
Creates an XVColor from a packed 32-bit integer in RGBA byte order.
factory
- XVColor.gray(int value)
-
Creates a grayscale XVColor where R, G, and B have the same
value.const
Properties
- a → int
-
The alpha (transparency/opacity) channel value (0 to 255, default: 255).
final
- b → int
-
The blue channel intensity value (0 to 255).
final
- g → int
-
The green channel intensity value (0 to 255).
final
- hashCode → int
-
The hash code for this object.
no setterinherited
-
props
→ List<
Object?> -
The list of properties that will be used to determine whether
two instances are equal.
no setter
- r → int
-
The red channel intensity value (0 to 255).
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- stringify → bool
-
If set to
true, the toString method will be overridden to output this instance's props.no setter
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toInt(
) → int - Converts the color to a packed 32-bit integer in RGBA byte order.
-
toString(
) → String - A string representation of this object.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Constants
- aqua → const XVColor
- beige → const XVColor
- black → const XVColor
- blue → const XVColor
- brown → const XVColor
- chocolate → const XVColor
- coral → const XVColor
- crimson → const XVColor
- cyan → const XVColor
- darkGreen → const XVColor
- darkGrey → const XVColor
- darkOrange → const XVColor
- forestGreen → const XVColor
- gold → const XVColor
- green → const XVColor
- grey → const XVColor
- hotPink → const XVColor
- indigo → const XVColor
- ivory → const XVColor
- khaki → const XVColor
- lavender → const XVColor
- lightBlue → const XVColor
- lightGreen → const XVColor
- lightGrey → const XVColor
- lime → const XVColor
- magenta → const XVColor
- maroon → const XVColor
- olive → const XVColor
- orange → const XVColor
- orchid → const XVColor
- pink → const XVColor
- plum → const XVColor
- purple → const XVColor
- red → const XVColor
- salmon → const XVColor
- skyBlue → const XVColor
- steelBlue → const XVColor
- tan → const XVColor
- teal → const XVColor
- transparent → const XVColor
- turquoise → const XVColor
- violet → const XVColor
- white → const XVColor
- yellow → const XVColor