gecol-core
A perception-aware accent color extractor and dynamic theme generator.
Table of Contents
How to get it
This crate is available on crates.io.
With cargo
Example
Full pipeline
You can extract a color, generate a theme and build a template using only a few lines of code:
use *;
let config = default;
// 1. Extract the color from the given image
if let Some = extract_cached?
Template syntax
In the templates, you have access to a rich object-oriented color API:
background = "{{ background }}"
transparent_bg = "{{ background.hexa(0.8) }}"
hover_color = "{{ background.lighten(0.1) }}"
border = rgba({{ primary.rgb }}aa)
Configuration
The [ExtractionConfig] struct allows fine-tuning of the extraction
algorithm, such as saliency bonus, warmth bias and so on. You can read more
about all the fine-tuning options in the [ExtractionConfig]
documentation.
Links
- Author: Martan03
- GitHub repository: gecol
- Package: crates.io
- Documentation: docs.rs
- Author website: martan03.github.io