Skip to content

jerbear2008/colornames-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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 'jsr:@jer/colornames'

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!

About

Access colornames.org through node.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published