2.0.0 • Published 1 year ago

to-color-string v2.0.0

Weekly downloads
-
License
MIT
Repository
-
Last release
1 year ago

to-color-string

Convert text to hex color codes with JS String.prototype method.

Try it

https://daddybannk.github.io/to-color-string

Installation

In a browser

<script src="to-color-string/dist/index.js"></script>

Using npm

npm i to-color-string

Usage

String.toColorString()

import "to-color-string";

// case: empty string
console.log("".toColorString()); 
// "#d41d8c"

// case: single character
console.log("h".toColorString()); 
// "#2510c3"

// case: sentence
console.log(`Hello, is it me you're looking for?`.toColorString()); 
// "#b1f23d"

Test

npm i -D
npm run test

License

This project is licensed under the terms of the MIT license.

2.0.0

1 year ago

1.0.1

2 years ago

1.0.0

2 years ago