Skip to content

Instantly share code, notes, and snippets.

@davidnormo
Created April 6, 2014 20:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • 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