Skip to content

Instantly share code, notes, and snippets.

@davidnormo
Created April 6, 2014 20:49
Show Gist options
  • Save davidnormo/10011302 to your computer and use it in GitHub Desktop.
Save davidnormo/10011302 to your computer and use it in GitHub Desktop.
CSS Pixel to Twips Conversion
/**
* Pixels to Twips conversion
* @param {Int} pixels
* @return {Int}
* /
var pixelsToTwips = function(pixels){
return pixels * 15;
};
/**
* Twips to Pixels conversion
* @param {Int} twips
* @return {Int}
* /
var twipsToPixels = function(twips){
return twips / 15;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment