public static int gradientRatio(double ratio){
  return (int)StrictMath.rint(ratio * 255);
}

public static int gradientRatio ( double ratio ) { return ( int ) StrictMath . rint ( ratio * 255 ) ; }
converts a gradient ratio specified as a double in the range 0 . 0 to 1 . 0 to an integer in the range required by the swf format between 0 and 255 .
