Skip to content
This repository has been archived by the owner on Nov 20, 2022. It is now read-only.

Latest commit

 

History

History
29 lines (19 loc) · 763 Bytes

README.md

File metadata and controls

29 lines (19 loc) · 763 Bytes

to-hex-color-code

Convert a string to a six character hexadecimal color code.

NPM JavaScript Style Guide

Install

npm install --save to-hex-color-code

Usage

import toHexColorCode from 'to-hex-color-code'

toHexColorCode('ABC');      // output: #AABBCC
toHexColorCode('ABCABC');   // output: #ABCABC
toHexColorCode('INVALID');  // output:

toHexColorCode('#ABC');     // output: #AABBCC
toHexColorCode('#ABCABC');  // output: #ABCABC
toHexColorCode('#INVALID'); // output:

License

MIT © LSVH