Socket
Book a DemoInstallSign in
Socket

iromi

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

iromi

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

latest
Source
npmnpm
Version
1.0.1
Version published
Maintainers
1
Created
Source

Iromi

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

npm version Build Status codecov

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)'

PostCSS

Soon.

FAQs

Package last updated on 28 May 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts