@sphinxxxx/color-conversion
Convert colors between RGBA/HSLA/Hex
Last updated 7 years ago by sphinxxxx .
ISC · Repository · Bugs · Original npm · Tarball · package.json
$ gnpm install @sphinxxxx/color-conversion 
SYNC missed versions from official npm registry.

color-conversion

JavaScript library for color conversion and manipulation with support for CSS color syntax.

Demo: https://rawgit.com/Sphinxxxx/color-conversion/master/demo/index.html

Usage

<script src="https://unpkg.com/@sphinxxxx/color-conversion@2"></script>

<script>
    //rgba/hsla/hex string, CSS color name, or rgba array:
    var color = new Color('rgb(200, 250, 0)');
    
    color.hsla;  // [0.2, 1, 0.49, 1]
    color.rgba;  // [200, 250, 0, 1]
    
    color.hslaString;  // "hsla(72,100%,49.02%,1)"
    color.rgbaString;  // "rgba(200,250,0,1)"
    color.hex;         // "#c8fa00ff"
</script>

Current Tags

  • 2.2.2                                ...           latest (5 years ago)

8 Versions

  • 2.2.2                                ...           5 years ago
  • 2.2.1                                ...           6 years ago
  • 2.2.0                                ...           6 years ago
  • 2.1.1                                ...           7 years ago
  • 2.1.0                                ...           7 years ago
  • 2.0.0                                ...           7 years ago
  • 2.0.0-alpha.3                                ...           7 years ago
  • 2.0.0-alpha.2                                ...           7 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (0)
None
Dev Dependencies (12)
Dependents (1)

Copyright 2013 - present © cnpmjs.org | Home |