webber007 / palette-js

Javascript implementation of the android palette library

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

palette-js

Javascript implementation of the android palette library example

Usage

Download palette.min.js from this directory, include the scripts in your HTML:

<script src="palette.min.js"></script>

Then use it like this:

let image = new Image();
image.src = './images/flowers.bmp';
image.onload = function () {
    let palette = new Palette(image);
    console.log('DominantColor', palette.getDominantColor());
    console.log('VIBRANT', palette.getVibrantColor());// Nullable
    console.log('LIGHT_VIBRANT', palette.getLightVibrantColor());// Nullable
    console.log('DARK_VIBRANT', palette.getDarkVibrantColor());// Nullable
    console.log('MUTED', palette.getMutedColor());// Nullable
    console.log('LIGHT_MUTED', palette.getLightMutedColor());// Nullable
    console.log('DARK_MUTED', palette.getDarkMutedColor());// Nullable
}

Thanks

Anroid Palette Library

TinyQueue

About

Javascript implementation of the android palette library


Languages

Language:JavaScript 89.7%Language:HTML 10.3%