DynamicColor class
The DynamicColor class represents a color in RGB format with an optional opacity value.
This class can be used to define colors dynamically and supports JSON serialization and deserialization.
Constructors
- DynamicColor({int? r, int? g, int? b, double? opacity})
- Creates a DynamicColor with the specified red r, green g, blue b, and optional opacity values.
-
DynamicColor.fromJson(Map<
String, dynamic> json) - Creates a DynamicColor object from a JSON map.
Properties
- b ↔ int?
-
The blue component of the color (0-255).
getter/setter pair
- g ↔ int?
-
The green component of the color (0-255).
getter/setter pair
- hashCode → int
-
The hash code for this object.
no setterinherited
- opacity ↔ double?
-
The opacity of the color (0.0 to 1.0).
getter/setter pair
- r ↔ int?
-
The red component of the color (0-255).
getter/setter pair
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
) → Map< String, dynamic> - Converts the DynamicColor object into a JSON map.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited