Image color analysis using a modified version of Color Thief.
Analyzes HTML5 video in near real time. Retrieve dominant color, brightest perceived color (luma), average color, and get a palette of colors.
quality- 0 is best but slower - 10 is default.sampleTime- interval at which to sample video - default is 100ms.algorithm-brightest,dominant,average, orcompletePalette(default).player- video element or object to drawevent- the event name to listen for when analyzing the video -timeupdateis default.callback- the callback when a color or palette is available.debug- boolean - whentruedisplays a palette div with the current colors retrieved.
All options except player and event can be set after initialization. For example
HueUtils.callback = function(palette) {
CoolLightsAPI.set(palette);
};Public methods to pause analysis, resume anaysis, and destroy the instance (clean up).
HueUtils.initialize(options);
HueUtils.pause();
HueUtils.resume();
HueUtils.destroy();