Skip to content

Primary colors extraction

ortfo/db supports extracting the most proeminent colors from the works' images. This can be useful to give a 🎀 colorful touch 🎀 to your website

Usage example

On ewen.works

Configuration

Enable it in ortfodb.yaml:

yaml
extract colors:
  enabled: true
  extract: []
  default files: []

enabled

Controls whether ortfo/db will try to extract colors or not

extract

Array of

default files

TODO

In database.json

Each media content block will have a colors object that contains the proeminent colors of the media:

json
{
  "ideaseed": {
    "content": {
      "en": {
        "blocks": [
          {
            "id": "Sw0WJU8osY",
            "type": "media",
            ...
            "hasSound": false,
            "colors": {
                "primary": "#FEF3ED",
                "secondary": "#858585",
                "tertiary": "#FCC696"
            }, 
            "thumbnails": {
                "100": "ideaseed/Sw0WJU8osY@100.webp",
            ...