Skip to content

small and simple js library to easily create a color gradient for as many colors as wanted

Notifications You must be signed in to change notification settings

jetpack/js.colorGradient

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

js.colorGradient


About

This small javascript library calculates a gradient of multiple colors. The result and whole gradient can be accessed via percentage. The gradient will only be calculated once to save execution time.

Basic Usage

1.) Include library:

<script type="text/javascript" src="color.gradient.min.js"></script>

2.) Initialize by pass a color array for the gradient and read the values by percentage selector:

var gradient = new ColorGradient(["#f00", "#0f0", "#00f"]);
var color = gradient.getHexColorAtPercentage([0...100]);

Take a look at the example for more details.

Bugs / Feature request

Please report bugs and feel free to ask for new features directly on GitHub.

License

js.colorGradient is dual-licensed under MIT and GPL-2.0 license.

About

small and simple js library to easily create a color gradient for as many colors as wanted

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 67.6%
  • HTML 32.4%