octopal
beautiful POC
Sebuah skrip untuk meraih palet warna dari gambar. Menggunakan JavaScript dan tag Canvas untuk mewujudkannya.
Cobalah Online: Palette.junglestar.org
Octopal adalah pekerjaan GUI berdasarkan:
Lihat demo | Baca lebih lanjut di blog Lokeshdhakar
var colorThief = new ColorThief ( ) ;
colorThief . getColor ( sourceImage ) ; getColor ( sourceImage [ , quality ] )
returns { r : num , g : num , b : num }Dalam contoh ini, kami membangun palet 8 warna.
var colorThief = new ColorThief ( ) ;
colorThief . getPalette ( sourceImage , 8 ) ; getPalette ( sourceImage [ , colorCount , quality ] )
returns [ [ num , num , num ] , [ num , num , num ] , ... ]npm install