getHeight static method

double getHeight(
  1. double pixels
)

Get the proportionate height as per screen size.

If screen height is 640px, pixels is 20px, y = 640 / 20 = 32,

Return 640 / 32 = 20.

Implementation

static double getHeight(double pixels) {
  return (pixels / height) * height;
}