getAlphaFromOpacity method

int getAlphaFromOpacity (
  1. double opacity
)

Returns an alpha value representative of the provided opacity value.

The opacity value may not be null.

Implementation

static int getAlphaFromOpacity(double opacity) {
  assert(opacity != null); // ignore: unnecessary_null_comparison
  return (opacity.clamp(0.0, 1.0) * 255).round();
}