1.0.6 • Published 6 years ago

invert-rgb v1.0.6

Weekly downloads
1
License
MIT
Repository
github
Last release
6 years ago

invert-rgb

inverts color of the given DOM element

supported color formats
  • Hexadecimal #f0f, #ff00ff
  • RGB rgb(255, 255, 255)
  • RGBA rgba(0, 0, 0, 0.5)
  • HSL hsl(120, 100%, 50%) /* green */
  • HSLA hsla(120, 100%, 50%, 0.3) /* green with opacity */
  • Predefined/Cross-browser color names red, green, blue

Installation

npm install invert-rgb

Usage

const { invertRgb } = require('invert-rgb')
let element = document.getElementById('#test') 
invertRgb(element, 'border-color') /* red -> rgb(255, 0, 0) -> rgb(0, 255, 255) */ 

Demo

before

before

after

after

Setup for demo

npm install
webpack
1.0.6

6 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago