1 repositorio
Extracts the dominant color from an image and applies it as a background, with automatic text contrast adjustment.
Distinct from jQuery Plugins: Distinct from jQuery Plugins: specifically focuses on color extraction and application with contrast adjustment, not general DOM interaction.
Explore 1 awesome GitHub repository matching web development · Color Extraction Plugins. Refine with filters or upvote what's useful.
This is a jQuery plugin that extracts the dominant color from an image or CSS background image and applies it as a background color on a target element. It uses canvas-based pixel analysis with an RGB quantization algorithm to identify the most prominent color, then injects that color as an inline CSS background-color style. The plugin automatically normalizes text contrast by calculating the relative luminance of the extracted color and toggling between dark and light text to maintain readability. It includes an image preloading pipeline to ensure pixel data is available synchronously from t
Extracts the dominant color from an image and applies it as a background with automatic text contrast adjustment.