gen method

TransformationData gen(
  1. String? backgroundImage,
  2. String? backgroundColor,
  3. double? shadowAngle,
  4. double? shadowIntensity,
)

Method for AI Soft Shadow Generator

  • backgroundImage : Background Image (Default: )

  • backgroundColor : Background Color (Default: "ffffff")

  • shadowAngle : Shadow Angle (Default: 120)

  • shadowIntensity : Shadow Intensity (Default: 0.5)

Returns TransformationData.

Implementation

TransformationData gen(
  String? backgroundImage,
  String? backgroundColor,
  double? shadowAngle,
  double? shadowIntensity,
) {
  // Determine if there are values to add to the dictionary

  var values = <String, String>{};

  if (backgroundImage != null) {
    values['bgi'] = backgroundImage.toString();
  }

  if (backgroundColor != null && backgroundColor.isNotEmpty) {
    values['bgc'] = backgroundColor;
  }

  if (shadowAngle != null) {
    values['a'] = shadowAngle.toString();
  }

  if (shadowIntensity != null) {
    values['i'] = shadowIntensity.toString();
  }

  return TransformationData(plugin: 'shadow', name: 'gen', values: values);
}