1.0.2 • Published 8 years ago

background-color-changer v1.0.2

Weekly downloads
2
License
ISC
Repository
github
Last release
8 years ago

background-color-changer

Changes the background color of a given element in a random fashion.

Installation

npm install --save background-color-changer

Usage

import BackgroundColorChanger from 'background-color-changer';

BackgroundColorChanger(<element>, <iterations>, <interval>);

Options

ArgumentDefaultDescription
elementundefinedDOM Element to change the background color of
iterations10Number of times to change the background color
interval1000Milliseconds to wait between each color change

Notes

  • The background color will start changing immediately upon instantiation
  • Colors are random and guaranteed not to repeat

Example

import BackgroundColorChanger from 'background-color-changer';

// Cause background color to change 10 times, once per second
BackgroundColorChanger(document.body, 10, 1000);
1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago