1.1.1 • Published 4 years ago

coolors-io v1.1.1

Weekly downloads
3
License
MIT
Repository
github
Last release
4 years ago

coolors-io

A simple JS script to parse or generate Coolors.co URLs to/from an array of hex values

Note: this project is in no way affiliated with Coolors.co and makes no guarantees about the stability of the coolors API. Based on the API as observed on 06/20/2020

Purpose:

Coolors.co has a great interface for rapidly creating color palettes and I wanted a way to more easily integrate it into my dev work

About Coolors URLs

Coolors URLs follow the format:

https://coolors.co/HEX-HEX-HEX-HEX-HEX-HEX

For example:

https://coolors.co/c3f73a-95e06c-68b684-094d92-1c1018

Notes:

  • Coolors URLs do not include '#'
  • Coolors URLs can have 1 - 10 hex values
    • Less than one will point to the landing page
    • More than ten will return a 404 error
  • The order of hex values is significant in Coolors URLs and is preserved in parse and gen

Getting Started

npm install coolors-io

coolors.parse

  import { parse } from 'coolors-io'

  const exampleCoolor = 'https://coolors.co/243cf2-9e8f19-a81470-4553bf-4a5396'

  parse(exampleCoolor)
    // returns [ '#898952', '#b2945b', '#d0e562', '#b6d369', '#93c48b' ]
    .then(console.log)

coolors.gen

  import { gen } from 'coolors-io'

  const exampleArray = ['feffef', '#ffeffe']

  gen(exampleArray)
    // returns https://coolors.co/feffef-ffeffe
    .then(console.log)
1.1.1

4 years ago

1.0.15

4 years ago

1.0.14

4 years ago

1.0.13

4 years ago

1.0.12

4 years ago

1.0.11

4 years ago

1.0.10

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.9

4 years ago

1.0.8

4 years ago

1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.0

4 years ago