An open API service indexing awesome lists of open source software.

https://github.com/fcor/ppi

PPI Calculator NPM package
https://github.com/fcor/ppi

Last synced: over 1 year ago
JSON representation

PPI Calculator NPM package

Awesome Lists containing this project

README

          

# PPI Calculator

ppicalculator calculates pixels per inch for a certain screen

## Description

PPI is a bit more correct, but DPI is the more common term. If you are interested, you can read more in this [Wikipedia Article](https://en.wikipedia.org/wiki/Pixel_density).

## Install

```
npm install ppicalculator
```

## Usage

ppi(hRes, vRes, diagSize)

hRes: Horizontal resolution in Pixels

vRes: Vertical resolution in Pixels

diagSize: Diagonal size in inches

```
import ppi from 'ppicalculator'

ppi(1980, 1080, 13.3) // 166

```

## Credits

[Fabio Cortés](https://twitter.com/fabiojcortes)

## License

[MIT](https://opensource.org/licenses/MIT)