ncs-color

1.0.1 • Public • Published

ncs-color

Conversion tool for color values specified using the Natural Color System

This module converts colors represented in NCS format to their corresponding Hex or RGB values. It works both with first edition values and second edition values (i.e. NCS 5000-N or NCS S 2060-G20Y). Returns null if the color name is invalid. Note that this module does not check if the passed color value is actually possible to produce in actual manufacturing environments (only ~1950 colors are actually available).

Usage

CommonJS:

const ncsColor = require('ncs-color');
ncsColor.hex('NCS S 2080-G20Y'); // => '#65d636'

AMD:

require(['ncs-color'], function(ncsColor){
	ncsColor.rgb('NCS 5000-N'); // => 'rgb(127,127,127)'
});

Global:

<script src="https://unpkg.com/ncs-color@1/ncscolor.min.js"></script>
<script>
    ncsColor.hex('NCS S 2060-B'); // => '#399bd6'
</script>

Available on npm:

$ npm install ncs-color --save

License

MIT © Frederik Ring

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
1.0.167latest

Version History

VersionDownloads (Last 7 Days)Published
1.0.167
1.0.00
0.3.01
0.2.10
0.2.00
0.1.50
0.1.40
0.1.30
0.1.21
0.1.10
0.1.01

Package Sidebar

Install

npm i ncs-color

Weekly Downloads

55

Version

1.0.1

License

MIT

Unpacked Size

12.5 kB

Total Files

8

Last publish

Collaborators

  • m90