/ratio_maker

ratio maker

Primary LanguageRubyMIT LicenseMIT

RatioMaker Build Status Code Climate

Get width or height that scaling right aspect

Installation

Add this line to your application's Gemfile:

gem 'ratio_maker'

And then execute:

$ bundle

Or install it yourself as:

$ gem install ratio_maker

Usage

The standard formula

$ ratio_maker [width | height] original_width original_height [next_width | next_height]

You get next_width or next_height

For example

$ ratio_maker height 1200 626 300

You get next_height 156.5

Or

$ ratio_maker width 1200 626 50

You get next_width 95.84664536741214

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request ratio_maker

ratio maker