LightingConfig constructor
LightingConfig({
- required double radius,
- required Color color,
- bool withPulse = false,
- bool useComponentAngle = false,
- Curve pulseCurve = Curves.decelerate,
- double pulseVariation = 0.1,
- double pulseSpeed = 0.1,
- double? blurBorder,
- LightingType type = LightingType.circle,
- Vector2? align,
- LightingMode mode = LightingMode.cutout,
- LightFalloff falloff = LightFalloff.blur,
- double innerRadius = 0.35,
- double intensity = 1,
- BlendMode additiveBlendMode = BlendMode.plus,
- LightFlicker? flicker,
- bool castShadows = false,
Implementation
LightingConfig({
required this.radius,
required this.color,
this.withPulse = false,
this.useComponentAngle = false,
this.pulseCurve = Curves.decelerate,
this.pulseVariation = 0.1,
this.pulseSpeed = 0.1,
double? blurBorder,
this.type = LightingType.circle,
Vector2? align,
this.mode = LightingMode.cutout,
this.falloff = LightFalloff.blur,
this.innerRadius = 0.35,
this.intensity = 1,
this.additiveBlendMode = BlendMode.plus,
this.flicker,
this.castShadows = false,
}) : assert(intensity >= 0 && intensity <= 1),
assert(innerRadius >= 0 && innerRadius <= 1),
align = align?.clone() ?? Vector2.zero(),
blurBorder = blurBorder ?? radius {
_pulseAnimation = PulseValue(
speed: pulseSpeed,
curve: pulseCurve,
pulseVariation: pulseVariation,
);
_maskFilter = this.blurBorder > 0
? MaskFilter.blur(
BlurStyle.normal,
_convertRadiusToSigma(this.blurBorder),
)
: null;
}