2.0.5 • Published 3 months ago

colornames-api v2.0.5

Weekly downloads
-
License
MIT
Repository
github
Last release
3 months ago

Colornames API

A simple package for interacting with the Colornames API. Colornames is a crowdsourced database of color names, with the goal of naming every possible RGB color.

import * as colornames from 'colornames-api'

const color = await colornames.lookup('ff0000')
color.name // -> 'Red'

const randomColor = await colornames.random()
// -> { hexCode: 'e44c4a', name: 'Makes Me Hungry Orange' }

const latest = await colornames.latest()
console.log(`#${latest[0].hexCode}: ${latest[0].name}`)
// -> #b9484b: Stale Cherry

const count = await colornames.nameCount('Lemonhead Yellow')
console.log(`Lemonhead Yellow has been proposed ${count} times.`)
// -> Lemonhead Yellow has been proposed 2 times.

All functions and types have JSDoc comments, hover over them in your editor or see the documentation for more.

Links

If you have any questions, feel free to send me a Matrix or Discord (jerbear4328) message.

License

This package is licensed under the MIT License. If you use this package for somthing cool, please let me know!

2.0.3

3 months ago

2.0.5

3 months ago

2.0.4

3 months ago

2.0.1

3 months ago

1.2.0

2 years ago

1.1.0

2 years ago

1.0.0

2 years ago