to-color-string
TypeScript icon, indicating that this package has built-in type declarations

2.0.0 • Public • Published

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.

Readme

Keywords

Package Sidebar

Install

npm i to-color-string

Weekly Downloads

5

Version

2.0.0

License

MIT

Unpacked Size

9.07 kB

Total Files

7

Last publish

Collaborators

  • b5730200811