Light constructor
Light(
- dynamic color, [
- double? intensity
Implementation
Light(color, [double? intensity]) : super() {
type = "Light";
if (color is Color) {
this.color = color;
} else if (color is int) {
this.color = Color.fromHex(color);
} else {
throw ("Light init color type is not support $color ");
}
this.intensity = intensity ?? 1.0;
}