/react-ntc

React Hooks module for Name That Color project

Primary LanguageTypeScriptMIT LicenseMIT

react-ntc

React Hooks module for the Name That Color project.

npm version npm-publish npm downloads

Installation

To install react-ntc with npm:

npm install react-ntc

To install react-ntc with yarn:

yarn add react-ntc

Types

interface ColorMap {
	[key: string]: string;
}

interface ColorObject {
	name: string;
	hex: string;
}

type ColorTuple = [hex: string, name: string];

Hooks

useColors()

useColorObjects()

useColorTuples()

useLookupColors(hexValues: string[])

useLookupColorObjects(hexValues: string[])

useLookupColorTuples(hexValues: string[])

useNameThatColor(hexValue: string)

Functions

formatHex(hex: string)

formatHexValues(hexValues: string)

Demo

View demo here: https://alehechka.github.io/react-ntc/

License

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