Skip to content

🎨 WIP β€” Collection of JS colour functions that automate the selection of beautiful, accessible colours.

License

Notifications You must be signed in to change notification settings

corygibbons/iromi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

14 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Iromi

Iromi is a collection of JS colour functions that automate the selection of beautiful, accessible colours.

npm version code style: prettier

Install

$ npm install iromi --save

Functions

iromi.type(backgroundColor, contrast, size)

  • backgroundColor:
    • Valid colour string (#ffffff, rgb(0,0,0))
  • contrast:
    • 'default': AA compliant
    • 'more': AAA compliant
    • 'less: Not compliant
  • size:
    • 'small'
    • 'large'
const iromi = require('iromi');

// Will return a text colour that is AA compliant on #ffffff
textOnWhiteBg = iromi.type('#ffffff');

// Will return a text colour is AA compliant on #000000
textOnBlackBg = iromi.type('#000000');

// Iromi will try to return an AA compliant text colour if no contrast argument
// is given. The following will try to return an AAA compliant text colour.
textOnWhiteBgAAA = iromi.type('#ffffff', 'more');

// Since Iromi returns a tinycolor object it's easy to choose your format
textOnWhiteBg.toHexString(); // '#727272'
textOnWhiteBg.toRgbString(); // 'rgb(115, 115, 115)'

About

🎨 WIP β€” Collection of JS colour functions that automate the selection of beautiful, accessible colours.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published