Awesome-Python-Scripts/PX-to-REM/converter.py
Atthaphon Urairat 587a083db6
Added PX to REM, REM to Px as command line tools (#82)
Co-authored-by: Atthaphon Urairat <aurairat@inetasia.com>
Co-authored-by: Ayush Bhardwaj <classicayush@gmail.com>
2020-03-19 17:52:14 +05:30

12 lines
224 B
Python

class Converter:
base_px = 16
def __init__(self):
self.data = []
def px_to_rem(self, px):
return float(px) / self.base_px
def rem_to_px(self, rem):
return float(rem) * self.base_px