A array with color name -> decimal rgbs.

Overview

colors-named-decimal

Build & Deploy Open in unpkg npm version Coverage Status

A array with color name -> decimal rgbs. Based on https://www.w3.org/TR/css-color-4/#colors-named

Installation

This package is ESM only: Node 12+ is needed to use it and it must be import instead of require.

npm install colors-named-decimal

If you still want to use in CommonJS, you can use dynamic import() to load.

const named = await import('colors-named-decimal');

// Fix compiling in typescript.
// https://github.com/microsoft/TypeScript/issues/43329#issuecomment-922544562
const named = await (Function('return import("colors-named-decimal")')()) as Promise<typeof import("colors-named-decimal")>;

Usage

import decimal from "colors-named-decimal";

console.log(decimal)
// =====>
// [
//   [240, 248, 255],
//   [250, 235, 215],
//   [0, 255, 255],
//   [127, 255, 212],
//   [240, 255, 255],
//   [245, 245, 220],
//   [255, 228, 196],
//   ...
// ]
console.log(decimal.length)   // => 148
'colors-named'                'colors-named-hex'          'colors-named-decimal'
===============              ===================         =====================
const named = [                const hexs = [             const hexs = [
  'aliceblue',         ->        '#F0F8FF',       ->        [240, 248, 255],
  'antiquewhite',      ->        '#FAEBD7',       ->        [250, 235, 215],
  'aqua',              ->        '#00FFFF',       ->        [0, 255, 255],
  'aquamarine',        ->        '#7FFFD4',       ->        [127, 255, 212],
  'azure',             ->        '#F0FFFF',       ->        [240, 255, 255],
  'beige',             ->        '#F5F5DC',       ->        [245, 245, 220],
  'bisque',            ->        '#FFE4C4',       ->        [255, 228, 196],
  'black',             ->        '#000000',       ->        [0, 0, 0],
  'blanchedalmond',    ->        '#FFEBCD',       ->        [255, 235, 205],
  'blue',              ->        '#0000FF',       ->        [0, 0, 255],
  'blueviolet',        ->        '#8A2BE2',       ->        [138, 43, 226],
  'brown',             ->        '#A52A2A',       ->        [165, 42, 42],
  ...                  ->        ...              ->        ...
];                             ];                         ];
import hexs from "colors-named-hex";
import named from "colors-named";
import decimal from "colors-named-decimal";

decimal[named.indexOf('aliceblue')] // => [240, 248, 255]
decimal[named.indexOf('red')]       // => [255, 0, 0]
decimal[named.indexOf('black')]     // => [0, 0, 0]

hexs[named.indexOf('aliceblue')] // => #F0F8FF
hexs[named.indexOf('red')]       // => #FF0000
hexs[named.indexOf('black')]     // => #000000

API

/**
 * A array with color name -> decimal rgbs. Based on https://www.w3.org/TR/css-color-4/#colors-named
 */
declare const decimal: number[][];
export default decimal;

Related

Contributors

As always, thanks to our amazing contributors!

Made with action-contributors.

License

Licensed under the MIT License.

You might also like...

A tool for creating and maintaining cohesive, consistent, and accessible color palettes

A tool for creating and maintaining cohesive, consistent, and accessible color palettes

Primer Prism Primer Prism is a tool for creating and maintaining cohesive, consistent, and accessible color palettes. 🌈 primer.style/prism 📝 Read th

Jan 3, 2023

A TypeScript package to calculate WCAG 2.0/3.0 and APCA color contrasts

a11y-color-contrast A simple utility package for working with WCAG 2.2/3.0 color contrasts a11y: Built for checking how readable colors are together S

Oct 10, 2022

A simple Discord bot that will listen for HEX, RGB(a), and HSL(a) colors in a message, and provide a small image of that color.

A simple Discord bot that will listen for HEX, RGB(a), and HSL(a) colors in a message, and provide a small image of that color.

Pigment For the teams of designers and developers out there - Pigment will listen for messages containing a HEX, RGB(a), or HSL(a) color, and provide

Dec 8, 2022

A string of four operations of the library, can solve the js digital calculation accuracy of scientific notation and formatting problems, support for thousands of decimal point formatting output operations

A string of four operations of the library, can solve the js digital calculation accuracy of scientific notation and formatting problems, support for thousands of decimal point formatting output operations

Apr 6, 2022

Small utilities for big decimal numbers.

dnum dnum (Decimal Numbers) is a library that allows to operate on large numbers represented as a pair composed of a BigInt for the value, and a Numbe

Dec 21, 2022

This project is created to store the name of the book and the name of its author, build with JavaScript.

awesome-books A plain javascript project that can keep track of a list of books utilizing localStorage. See live demo Built With HTML CSS Javascript T

Jul 19, 2022

🦎 A jQuery plugin for extracting the dominant color from images and applying the color to their parent.

🦎 A jQuery plugin for extracting the dominant color from images and applying the color to their parent.

jquery.adaptive-backgrounds.js A simple jQuery plugin to extract the dominant color of an image and apply it to the background of its parent element.

Dec 21, 2022

Change the color of an image to a specific color you have in mind.

image-recolor Run it: https://image-recolor.vercel.app/ image.recolor.mov Acknowledgments Daniel Büchele for the algorithm: https://twitter.com/daniel

Oct 25, 2022

Colormath.js - a color conversion and color manipulation library written in typescript for Node.js, Deno and Browser

Colormath.js - a color conversion and color manipulation library written in typescript for Node.js, Deno and Browser

Feb 8, 2022

A little toy app to help you find the nearest match for a given color within a Figma Tokens color palette.

A little toy app to help you find the nearest match for a given color within a Figma Tokens color palette.

Hey Palette So you've got a color palette in Figma and you've used the Figma Tokens plugin to export that palette to JSON. Let's say you have a color

Nov 15, 2022

Tool Cool Color Picker is a color picker library written in typescript and using web component technologies.

Tool Cool Color Picker is a color picker library written in typescript and using web component technologies.

Tool Cool Color Picker Tool Cool Color Picker is a color picker library written in typescript and using web component technologies. Check out the demo

Oct 23, 2022

Colr Pickr, a vanilla JavaScript color picker component built with SVGs, with features like saving colors. Similar design to the chrome-dev-tools color picker.

Colr Pickr, a vanilla JavaScript color picker component built with SVGs, with features like saving colors. Similar design to the chrome-dev-tools color picker.

Colr Pickr Colr Pickr, a vanilla JavaScript color picking component built with SVGs, with features like saving colors. Similar design to the chrome-de

Jun 27, 2022

A NodeJS package to convert any RGB color to HEX color or viceversa. Also supports HSL conversion.

Unhex 🎨 A NodeJS package to convert any RGB color to HEX, HSL color or viceversa. Example div { color: #fff; background-color: #0070f3; } After r

Oct 1, 2022

⚡️ A resource to help figure out what JavaScript array method would be best to use at any given time

JavaScript Array Explorer When I was first learning array methods, I spent a lot of time digging through the docs to find the appropriate one, and I h

Jan 2, 2023

Fundamentos, estruturas, função, objeto, array e etc...

JavaScript Fundamentos, estruturas, função, array e etc... Atividades praticas detalhadas e comentadas para todo mundo entender cada tag, bons estudos

Feb 27, 2022

Complete JavaScipt Array methods Cheatsheet 🚀

Complete JavaScipt Array methods Cheatsheet 🚀

Javascript Array Cheatsheet 👾 Click to download ☝ Important 🚨 There is no way this is perfect or include all the methods. I'll try to fix/add more m

Dec 7, 2022

Draft specification for a proposed Array.fromAsync method in JavaScript.

Array.fromAsync for JavaScript ECMAScript Stage-1 Proposal. J. S. Choi, 2021. Specification available Polyfill available Why an Array.fromAsync method

Dec 14, 2022

Manipulando dados de um Array com Nodejs, Usei o postman para testar as rotas.

Manipulando dados de um Array com Nodejs, Usei o postman para testar as rotas.

CRUD-MysqlNodejs Pre-requisitos que devem estar instalados: NodeJs Git Ferramentas utilizadas Visual Studio Code Postman Antes de iniciar o CRUD Antes

Aug 4, 2022

Analisador de números utilizando Array JavaScript com Html 5 e CSS 3

Olá pessal, tudo bem? :D Esse site foi desenvolvido para analisar números armazenados em um array chamado "dados[]". Temos dois botões um input e uma

Jan 6, 2022
Comments
  • Dependency Dashboard

    Dependency Dashboard

    This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

    Other Branches

    These updates are pending. To force PRs open, click the checkbox below.

    • [ ] chore(deps): update jaywcjlove/create-tag-action action to v1.3.15
    • [ ] chore(deps): update jaywcjlove/changelog-generator action to v1.6.2

    Detected dependencies

    github-actions
    .github/workflows/ci.yml
    • actions/checkout v3
    • actions/setup-node v3
    • jaywcjlove/create-tag-action v1.3.8
    • jaywcjlove/changelog-generator v1.5.7
    • peaceiris/actions-gh-pages v3
    • jaywcjlove/changelog-generator v1.5.7
    • ncipollo/release-action v1
    • JS-DevTools/npm-publish v1
    • actions/checkout v3
    • actions/setup-node v3
    npm
    package.json
    • colors-named ^1.0.0
    • husky ^8.0.1
    • lint-staged ^13.0.3
    • prettier ^2.7.1
    • tsbb ~3.7.6
    • node >=14.16

    • [ ] Check this box to trigger a request for Renovate to run again on this repository
    opened by renovate[bot] 0
Releases(v1.0.0)
Owner
小弟调调™
(͡·̮̃·̃) 如今撸码,像是早上起来需要刷牙一样的习惯。
小弟调调™
JavaScript library for all kinds of color manipulations

Chroma.js Chroma.js is a tiny small-ish zero-dependency JavaScript library (13.5kB) for all kinds of color conversions and color scales. Usage Initiat

Gregor Aisch 9.2k Jan 4, 2023
:rainbow: Javascript color conversion and manipulation library

color JavaScript library for immutable color conversion and manipulation with support for CSS color strings. var color = Color('#7743CE').alpha(0.5).l

Qix 4.5k Jan 3, 2023
JavaScript Library for creating random pleasing colors and color schemes

#PleaseJS www.checkman.io/please Please.js is a polite companion that wants to help you make your projects beautiful. It uses HSV color space to creat

Jordan Checkman 2.3k Dec 22, 2022
Fast, small color manipulation and conversion for JavaScript

TinyColor JavaScript color tooling TinyColor is a small, fast library for color manipulation and conversion in JavaScript. It allows many forms of inp

Brian Grinstead 4.5k Jan 1, 2023
Coloris - A lightweight and elegant JavaScript color picker. Written in vanilla ES6, no dependencies. Accessible.

Coloris A lightweight and elegant JavaScript color picker written in vanilla ES6. Convert any text input field into a color field. View demo Features

Momo Bassit 126 Dec 27, 2022
Color2k - a color parsing and manipulation lib served in roughly 2kB

color2k a color parsing and manipulation lib served in roughly 2kB or less (2.8kB to be more precise) color2k is a color parsing and manipulation libr

Rico Kahler 506 Dec 31, 2022
A simple color picker application written in pure JavaScript, for modern browsers.

Color Picker A simple color picker application written in pure JavaScript, for modern browsers. Has support for touch events. Touchy… touchy… Demo and

Taufik Nurrohman 207 Dec 14, 2022
A CLI utility to calculate/verify accessible magic numbers for a color palette.

A11y Contrast A CLI utility to calculate/verify accessible magic numbers for a color palette. Read my blog post for some more information. Installatio

Darek Kay 23 Nov 13, 2022
A dependency-free image color extraction library

Color mage A dependency-free image color extraction library. The extraction consists of using K-Means algorithm. It has a few utility functions as wel

Gilmar Quinelato 4 Mar 11, 2022
Create your own complete Web color system fast and easy!

Simpler Color Create your own complete Web color system fast and easy, from as little as one base color! Color is at the heart of every UI design syst

Arnel Enero 278 Dec 20, 2022