colornames

WebJar for colornames

License

License

MIT
GroupId

GroupId

org.webjars.npm
ArtifactId

ArtifactId

colornames
Last Version

Last Version

1.1.1
Release Date

Release Date

Type

Type

jar
Description

Description

colornames
WebJar for colornames
Project URL

Project URL

http://webjars.org
Source Code Management

Source Code Management

https://github.com/timoxley/colornames

Download colornames

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.npm/colornames/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>colornames</artifactId>
    <version>1.1.1</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/colornames/
implementation 'org.webjars.npm:colornames:1.1.1'
// https://jarcasting.com/artifacts/org.webjars.npm/colornames/
implementation ("org.webjars.npm:colornames:1.1.1")
'org.webjars.npm:colornames:jar:1.1.1'
<dependency org="org.webjars.npm" name="colornames" rev="1.1.1">
  <artifact name="colornames" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='colornames', version='1.1.1')
)
libraryDependencies += "org.webjars.npm" % "colornames" % "1.1.1"
[org.webjars.npm/colornames "1.1.1"]

Dependencies

There are no dependencies for this project. It is a standalone project that does not depend on any other jars.

Project Modules

There are no modules declared in this project.

colornames

Convert color names to HEX color values.

NPM NPM

Build Status Dependency Status

Installation

Component

$ component install timoxley/colornames

Node/Browserify

$ npm install colornames

Example

var toHex = require('colornames')

VGA color names

toHex('red') // => "#FF0000"
toHex('blue') // => "#0000FF"

CSS color names

toHex('lightsalmon') // => "#FFA07A"
toHex('mediumvioletred') // => "#C71585"

Get meta data about a color

toHex.get('red')
// =>
{
  name: "red",
  css: true,
  value: "#FF0000",
  vga: true
}

Conversion is case-insensitive

toHex('Blue') // => "#0000FF"
toHex('BLUE') // => "#0000FF"
toHex('BlUe') // => "#0000FF"

API

colornames(name)

Get HEX code for a color name, or undefined if unknown.

.get(name)

All known data about color, including whether valid VGA or CSS color name.

.get.vga(name)

HEX code for a color name, only if the color is a valid VGA color name.

.get.css(name)

HEX code for a color name, only if the color is a valid CSS color name.

###.all() Get all color names data.

License

MIT

Complete Color Map

example-color-table-

Versions

Version
1.1.1
0.0.2