# string-to-color-react

> Generates a hexadecimal color depending on the input string, also allows passing default colors/schema

Latest version **1.0.3** (published 2023-06-29) · MIT license · 0 weekly downloads

## Install

```sh
npm install string-to-color-react
pnpm add string-to-color-react
yarn add string-to-color-react
bun add string-to-color-react
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.3 |
| Published | 2023-06-29 |
| First published | 2023-06-23 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 5.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Lucas dos Santos |
| Maintainers | luk94 |
| Keywords | react, color, string, generate |

## Links

- npm: https://www.npmjs.com/package/string-to-color-react
- Repository: https://github.com/lukke-dev/string-to-color-react
- Homepage: https://github.com/lukke-dev/string-to-color-react#readme
- Issues: https://github.com/lukke-dev/string-to-color-react/issues
- npm.io page: https://npm.io/package/string-to-color-react

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 1.0.3 (latest) — 2023-06-29
- 1.0.2 — 2023-06-29
- 1.0.1 — 2023-06-23
- 1.0.0 — 2023-06-23

## README

# String to color React

Generates a hexadecimal color depending on the input string, also allows passing default colors/schema.

[![npm version](https://badge.fury.io/js/string-to-color.svg)](https://badge.fury.io/js/string-to-color-react) ![](https://img.shields.io/npm/dm/string-to-color-react.svg)

## Install

```bash
npm install string-to-color-react
```
```bash
yarn add string-to-color-react
```
## Demo

Link: https://demo-string-to-color-react-bvecj2wl7-lukke-dev.vercel.app/

![Alt text](https://i.ibb.co/7Y776SJ/Screenshot-from-2023-06-29-14-29-20.png "Demo")

## Usage

```js
import { generateColorFromString } from 'string-to-color-react'
const primary = generateColorFromString('foo') // => "#c68c01"
const secondary = generateColorFromString('name') // => "#8b7a33"
```

or pass an array of options, like a schema!

```js
import { generateColorFromString } from 'string-to-color-react'
const schemaOptions = ['red', 'green', 'teal', 'yellow']
const color = generateColorFromString('foo', schemaOptions) // => "teal"
const color = generateColorFromString('name', schemaOptions) // => "yellow"
```
## License

MIT.

---
_Source: https://npm.io/package/string-to-color-react · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
