getAlphaFromOpacity static method

int getAlphaFromOpacity(
  1. double opacity
)
override

Returns an alpha value representative of the provided opacity value.

The opacity value may not be null.

Implementation

static int getAlphaFromOpacity(double opacity) {
  return (opacity.clamp(0.0, 1.0) * 255).round();
}