Home Posts GitHub Menu

rgbHex - Intro


Intro

The converter will automatically detect and convert between RGB and HEX formats.

Usage

The plugin supports various formats for usage.

es5

var rgbHex  = require('rgbhex');

console.log(rgbHex('rgb(0, 0, 0)')); // #000000

jQuery

<script src="/rgbHex/dist/jquery-rgbHex.min.js"></script>

<script>
    console.log($.rgbHex('rgb(0, 0, 0)')); // #000000
</script>

JavaScript

<script src="/rgbHex/dist/rgbHex.min.js"></script>

<script>
    console.log(window.rgbHex('rgb(0, 0, 0)')); // #000000
</script>