2.4.18 • Published 1 year ago

@devtea2027/dicta-asperiores-dolorem-quam v2.4.18

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

A11y Contrast

npm Build license

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

npm.io

Installation

This tool requires Node.js version 18+.

Install globally:

$ npm install -g @devtea2027/dicta-asperiores-dolorem-quam  # Npm
$ yarn add -g @devtea2027/dicta-asperiores-dolorem-quam     # Yarn

Or install as a local dependency:

$ npm install --save @devtea2027/dicta-asperiores-dolorem-quam  # Npm
$ yarn add @devtea2027/dicta-asperiores-dolorem-quam            # Yarn

Or use without installing:

$ npx @devtea2027/dicta-asperiores-dolorem-quam <file>

Usage

View program help:

$ @devtea2027/dicta-asperiores-dolorem-quam --help
Usage: @devtea2027/dicta-asperiores-dolorem-quam <file> [options]

Arguments:
  <file>  Color palette file                              [required] [file]

Options:
  --min-ratio-3    Verify magic number for ratio 3                 [number]
  --min-ratio-4.5  Verify magic number for ratio 4.5               [number]
  --min-ratio-7    Verify magic number for ratio 7                 [number]
  -h, --help       Show help                     [commands: help] [boolean]
  -v, --version    Show version number        [commands: version] [boolean]

Run a full report for a color palette file:

$ @devtea2027/dicta-asperiores-dolorem-quam <file>

Verify that the color palette fulfills certain magic numbers per contrast ratio:

$ @devtea2027/dicta-asperiores-dolorem-quam <file> --min-ratio-3=40 --min-ratio-4.5=50 --min-ratio-7=70

Color palette format

This tool handles flat or nested JSON files. Any consistent grading system is supported.

  • Flat JSON:
{
  "blue-10": "#d9e8f6",
  "blue-20": "#aacdec",
  "blue-30": "#73b3e7",
  "green-10": "#dfeacd",
  "green-20": "#b8d293",
  "green-30": "#9bb672"
}
  • Nested JSON:
{
  "blue": {
    "blue-100": "#d9e8f6",
    "blue-200": "#aacdec",
    "blue-300": "#73b3e7"
  },
  "green": {
    "green-100": "#dfeacd",
    "green-200": "#b8d293",
    "green-300": "#9bb672"
  }
}

Check out some example color palettes under /examples.

License

This project and its contents are open source under the MIT license.

2.4.18

1 year ago

2.4.17

1 year ago

2.4.16

1 year ago

2.4.15

1 year ago

1.3.13

1 year ago

1.3.14

1 year ago

1.4.15

1 year ago

1.4.14

1 year ago

1.3.12

1 year ago

1.2.12

1 year ago

1.1.12

1 year ago

1.1.11

1 year ago

1.1.10

1 year ago

1.1.9

1 year ago

1.1.8

1 year ago

1.1.7

1 year ago

1.1.6

1 year ago

1.1.5

1 year ago

1.1.4

1 year ago

1.1.3

1 year ago

1.1.2

1 year ago

1.1.1

1 year ago

1.1.0

1 year ago