Skip to content

stak-digital/javascript-module

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Element color changer

This is a demonstration on how to create a JavaScript library

Purpose

This was made to change the color of a clicked element to a random color from an array of color strings

Usage

npm install --save color-switch

import colorSwitch from ‘color-switch’;

const yourElement = document.getElementById(‘el’);
colorSwitch(yourElement, [
    ‘#f0f’,
    ‘red’,
    ‘rgba(0, 0, 0, 0.4)’,
    ‘green’
]);

About

Public coding demo for blog post

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published