rgba-translater

To translate rgba color to 16 binary model


Keywords
rgba, ie8, translater
License
MIT
Install
npm install rgba-translater@1.0.1

Documentation

RGBA translater

To translate rgba to 16 binary model

Usage:

npm install rgba-translater

Use to translate backgroundColor to compatible ie8

//require translater
var RGBATranslater = require('rgba-translater');  

var ele = document.getElementById('#example');
var bg = ele.style.backgroundColor;  
ele.style.filter = RGBATranslater(bg);  

If you only to get 16 binary color, you can set the colorOnly option to true, like so:

RGBATranslater(bg, true);  

Or if you only set the color to translate, you can use the translater core, like so:

var translaterCore = require('rgba-translater').translater;
var color = '255,255,255,0.9';
translaterCore(color); //return ccffffff;