Skip to content

Latest commit

History

History
40 lines (24 loc) 路 630 Bytes

README.md

File metadata and controls

40 lines (24 loc) 路 630 Bytes

Standard Color

Find the nearest Cyberscape Standard color from RGB or HEX.

Install

# Using npm
npm install --save cscape/stdcolor

# Using yarn
yarn add cscape/stdcolor

Example

const StdColor = require('@cyberscape/stdcolor')

// Absolute red
console.log(StdColor(255, 0, 0))

// Hex colors
console.log(StdColor('#f00'))

API

StdColor(r, g, b)

Returns: An RGB array of numbers with the closest matched values.

StdColor(hexString)

Returns: An RGB array of numbers with the closest matched values.

License

MITCyberscape.