LightColor.fromJson constructor
Creates a LightColor object from the JSON response to a GET request.
Implementation
factory LightColor.fromJson(Map<String, dynamic> dataMap) {
return LightColor(
xy: LightColorXy.fromJson(
Map<String, dynamic>.from(dataMap[ApiFields.xy] ?? {})),
gamut: LightColorGamut.fromJson(
Map<String, dynamic>.from(dataMap[ApiFields.gamut] ?? {})),
gamutType:
LightColorGamutType.fromString(dataMap[ApiFields.gamutType] ?? ""),
);
}