Nearest Normal Aspect Ratio
npm install nearest-normal-aspect-ratio
nearestNormalAspectRatio(width, height, [maxWidth], [maxHeight])
`
- width: The width of the space.
- height: The height of the space.
- maxWidth: The maximum width in the nearest normal aspect ratio. Defaults to 16.
- maxWidth: The maximum height in the nearest normal aspect ratio. Defaults to 16.
Install
`
npm install nearest-normal-aspect-ratio --save
`
Use
`js
import nearestNormalAspectRatio from 'nearest-normal-aspect-ratio';
let ratio = nearestNormalAspectRatio(801, 602);
console.log(ratio);
// 4:3
``