colornames-api
v2.0.5
Published
Use the colornames API for crowdsourced names for hex colors
Downloads
2
Readme
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!