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

LSVH/to-hex-color-code

Repository files navigation

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

About

Convert a string to a six character hexadecimal color code.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published