Color Coding Groups: auto-color words by group (color + bold)

AnkiWeb addon 267803161 Built with AI

Fork of 🎨 ColorCoding 🌈 - Automatically Color Specific Words (AI-detected; may be wrong)

1 other version of this addon exists. Compare versions ↓

Automatically colours and bolds words in notes according to assigned groups, storing colours in one stylesheet so changing a group recolours every occurrence everywhere.
AI-generated summary; may contain mistakes.

ainote-managementformattingfork-or-reuploadmobile-compatible

Open on AnkiWeb GitHub Find alternatives

AnkiWeb

Votes
0 (πŸ‘ 0 Β· πŸ‘Ž 0)
Updated
2026-11-12
Anki versions
26.05~
License
MIT (from the license file in the package)
Virus scan
No ClamAV match A match does not prove malware. No match does not prove that the code is safe.
Languages
Python, JavaScript, JSON
Description language
en

Maintenance

active

  • Last update or commit: 2026-11-12 (19 days before the snapshot).
  • Test files: 4.
  • Commits in the last year: 10.
  • Issues: 0 open, 0 closed.
  • Pull requests: 0 open, 0 merged.

Will it work on my Anki?

Version branches
Min AnkiMax AnkiUpdated
23.1026.05+2026-11-12
History across monthly snapshots

Loading…

Compare versions

The original addon and its forks. The best value in each column is in bold.

VersionWorks on Anki 26.09.4MaintenanceLast activity VotesApprovalGitHub starsNotes
🎨 ColorCoding 🌈 - Automatically Color Specific Words original likely stale 26 Aug 2025 πŸ‘ 18 Β· πŸ‘Ž 3 65% 3 beta
↳ Color Coding Groups: auto-color words by group (color + bold) this addon (AI-detected; may be wrong) likely active 12 Nov 2026 πŸ‘ 0 Β· πŸ‘Ž 0 – 0

Forks can add features or work in a different way. Read the description before you change to another version. Fork detection is incomplete, so other versions can exist.

Similar addons

Highlight Color Shortcut

Highlights selected text in eight configurable colors via Ctrl+Alt plus the color's first letter, with an optional bold setting and support for standard or hex color codes.

formattingshortcuts

21 votes 65% approval πŸ‘ 18 Β· πŸ‘Ž 3 ⭐ 0 Anki 2.1.16~ Updated 2021-04-01
Bold Color Shortcut fork

Adds editor keyboard shortcuts to quickly change selected text color, with an option to bold it, configurable via a settings file.

formattingshortcuts

10 votes 49% approval πŸ‘ 8 Β· πŸ‘Ž 2 ⭐ 0 Anki 2.1.16~ Updated 2021-04-01

Description

Colours words in your notes automatically, by group. Put "Paris" and "Kyoto" in a Places group (blue) and "Ada Lovelace" in People (pink, bold): every occurrence is coloured as you edit, and changing a group's colour recolours all its words, in every note, without touching them.

Anki editor with words coloured by group: people in bold pink, places in blue, dates in yellow

Every word you have put in a group is coloured in every field of the note. The C button in the toolbar re-colours; G opens the group picker.

Features

  • Groups with a colour and a bold flag. Words belong to a group; the group decides how they look.
  • Group manager (Tools β†’ 🎨 Color Coding 🌈 β†’ Manage Groups…): create, recolour, rename and delete groups.
  • Assign from the editor: select text, then right-click β†’ 🎨 Set color group, or press Meta+Shift+G for a keyboard-first group picker (Meta is the Control key on macOS and the Windows key on Windows/Linux).
  • Colours every field of the note, not just the focused one, and again whenever a note is loaded. The C button (Meta+Shift+H) forces a re-colour.
  • One stylesheet for all the colours. A coloured word stores its group, not a colour; the colours come from a stylesheet in your collection's media folder. Change a group's colour once and every note follows (on the next card you review; on AnkiDroid and AnkiMobile after a sync).
  • Colour a whole deck at once. Deck list β†’ gear β†’ 🎨 Color Coding: color this deck's notes (subdecks included), or select notes in the Browser β†’ Notes β†’ 🎨 Color Coding: color the words in selected notes. One undo step (Edit β†’ Undo) takes it back.
  • Choose which decks colour automatically (Tools β†’ 🎨 Color Coding 🌈 β†’ Font Settings).
  • Suggested colours: groups with a similar meaning get similar colours (see below).
  • Same markup as the original (<span class="ColorCoding" …>), so existing notes keep working. Old config formats are upgraded automatically.

Requires an Anki build with PyQt6 (23.10 or newer). Developed and used on Anki 26.05.

Suggested colours

Manage Groups… β†’ Suggest Colors… picks colours so that groups with a similar meaning get similar colours: Cities, Countries and Rivers in neighbouring blues, Drugs and Diseases in neighbouring greens. You see the result first, untick any group to keep its colour, and nothing is saved until you save the group manager.

The Suggest Colors dialog: service settings and a table of groups in colour-wheel order, with current and suggested colours

How it works: each group's name and a few of its words are turned into an embedding (a list of numbers that places the text by meaning). The add-on finds the shortest closed tour through the groups and walks it around the colour wheel, with a hue step proportional to how far apart neighbouring groups are. Colours are chosen for your current theme (dark or light).

It needs an embedding service that speaks the OpenAI /v1/embeddings API:

  • OpenAI: paste an API key (or start Anki with OPENAI_API_KEY set). A run is a few hundred tokens.
  • Ollama (local): ollama pull nomic-embed-text, keep Ollama running, choose Ollama (local). Nothing leaves your computer.
  • Other: LM Studio, llama.cpp, vLLM... any compatible address, model name and key.

Privacy: only when you press Suggest, and only to the address shown in the dialog, the add-on sends the group names and up to 8 words of each group. For a service that is not on your own computer it first shows exactly what it will send and asks. Your notes are never sent. The key is kept in plain text in the add-on's user_files/settings.json, readable by your user only.

Screenshots

Select a word, right-click, Set color group:

Right-click menu with a Set color group submenu listing the groups

The group picker (keyboard only) and the group manager (colour and bold per group, and Suggest Colors…):

Group picker dialog Group manager dialog

The settings window (Tools β†’ 🎨 Color Coding 🌈) lists every word with its group:

Settings window listing words, groups and colours

Colour a deck's notes from the deck list, and choose which decks colour automatically:

The deck list's gear menu with two Color Coding entries Settings: automatic colouring limited to the highlighted decks

Updating from an earlier version

Notes coloured by an earlier version (or by the original ColorCoding) keep their old fixed colours until they are coloured again: run color this deck's notes once per deck (it is one undo step; a backup first never hurts). The first time the add-on colours a note of a given type it adds one @import line to that note type's Styling; only the styling changes, so Anki does not ask for a full sync.

Coming from ColorCoding?

Installing this add-on disables the original ColorCoding (the two can't run together). Your words live in each add-on's own user_files/config.json: copy the original's file into this add-on's user_files/ folder (Tools β†’ Add-ons β†’ select β†’ View Files) to keep them.

Credits and source

Based on ColorCoding by Marc Schubert (AnkiWeb, GitHub). Thank you! Source code, issues and licence details: https://github.com/pointtonull/anki-colorcoding-groups

README

Color Coding Groups for Anki

An Anki add-on that colours words automatically, by group. Put "Paris" and "Kyoto" in a Places group (blue), "Ada Lovelace" in People (pink, bold), and every occurrence in your notes is coloured as you edit. Change a group's colour once and all its words follow.

It builds on ColorCoding by Marc Schubert (source) β€” see Credits.

Anki's editor with the words Ada Lovelace, Charles Babbage and Alan Turing in pink bold, London and Cambridge in blue and 1843 in yellow

Every word you have put in a group is coloured in every field of the note. The C button in the toolbar re-colours; G opens the group picker.

Screenshots

Right-click a selected word β†’ 🎨 Set color group to put it in a group (or create one):

The editor's right-click menu with a Set color group submenu listing Code, Dates, People, Places and Create new group

The group picker (Meta+Shift+G, the physical Control key on macOS) is keyboard-only: type to filter, ↑/↓, Enter. The group manager sets each group's colour and bold flag, and renames or deletes it:

The group picker dialog listing the groups, with Create new group and Manage groups at the bottom The group manager: a table of groups with colour swatches, a bold flag and Edit and Delete buttons

The settings window (Tools β†’ 🎨 Color Coding 🌈) lists every word with its group and colour:

The settings window: a table of words, their groups and colours

The screenshots are made from the add-on's real windows, in a throwaway Anki profile with invented words: python3 tools/make_screenshots.py regenerates them.

What it adds

  • Groups with a colour and a bold flag. Words belong to a group; the group decides how they look.
  • Group manager (Tools β†’ 🎨 Color Coding 🌈 β†’ Manage Groups…): create, recolour, rename, delete groups.
  • Assign from the editor. Select text and either right-click β†’ 🎨 Set color group, or press Meta+Shift+G (the physical Control key on macOS) for a keyboard-first group picker.
  • Colours every field of the note, not just the one with the cursor, and re-colours when a note is loaded. The C button (Meta+Shift+H) forces a re-colour.
  • Change a group's colour once and every note follows, with nothing to re-open or re-colour: the colours live in one stylesheet, not in the notes (how).
  • Colour a whole deck at once. Deck list β†’ gear β†’ 🎨 Color Coding: color this deck's notes (subdecks included), or select notes in the Browser β†’ Notes β†’ 🎨 Color Coding: color the words in selected notes. One undo step (Edit β†’ Undo) takes it back, and the matching remove colors entries strip the colouring again.
  • Choose which decks colour automatically. Tools β†’ 🎨 Color Coding 🌈 β†’ Font Settings turns on automatic colouring when a note opens in the editor and lets you limit it to some decks (and their subdecks).
  • Suggested colours. Manage Groups… β†’ Suggest Colors… gives groups with a similar meaning similar colours, using an embedding model from OpenAI, Ollama or any compatible service (how).
  • Config migration: the flat [{"word", "group", "color"}] list of the original and groups stored as bare colour strings are upgraded automatically.
The deck list's gear menu with two Color Coding entries Settings: automatic colouring, limited to the highlighted decks

Suggested colours

Choosing a colour per group by hand gets harder the more groups you have, and unrelated colours say nothing about how the groups relate. Manage Groups… β†’ Suggest Colors… picks them for you so that groups with a similar meaning get similar colours: Cities, Countries and Rivers land in neighbouring blues, Drugs and Diseases in neighbouring greens.

The Suggest Colors dialog: the service settings, and a table of groups in colour-wheel order with their current and suggested colours

You see the result before anything changes: untick a group to keep its colour, press Apply, and the colours are saved with the rest of the group manager (Cancel there throws them away).

How it works. Each group's name and a few of its words (Cities: London, Lisbon) are turned into an embedding, a list of numbers that places the text by meaning. The add-on then finds the shortest closed tour through the groups (a travelling-salesman route, exact up to 12 groups), so that groups that are close in meaning are neighbours, and walks it around the colour wheel with a hue step proportional to the distance to the next group, the step from the last group back to the first included. Steps never go below 16Β°, so two near-duplicate groups stay distinguishable. With more groups than that fits (about 22), neighbours alternate between a lighter and a darker shade as well. Colours are picked in OKLCH at a fixed lightness for your current theme (so they read equally well on a dark or a light background); re-run it after switching theme.

Which service. Anything that speaks the OpenAI /v1/embeddings API:

Service Setup
OpenAI Paste an API key (or leave the field empty and start Anki with OPENAI_API_KEY set). Model text-embedding-3-small. A few hundred tokens per run.
Ollama (local) ollama pull nomic-embed-text, keep Ollama running, pick Ollama (local). Nothing leaves your computer.
Other LM Studio, llama.cpp, vLLM, a gateway...: its /v1 address, a model name and, if it wants one, a key.

What is sent, and when. Only when you press Suggest, and only to the address shown in the dialog: the group names and up to 8 of each group's words. For a service that is not on your own computer the add-on first shows what it is about to send and asks. Your notes are never sent. The service and the key are remembered in user_files/settings.json (plain text, readable by your user only, never committed); an API key is never sent over plain http to a remote host.

How the colours are stored

A coloured word is stored as <span class="ColorCoding" data-name="Paris" data-group="Places">Paris</span>: the group, not a colour. The colours come from one stylesheet, _colorcoding_groups.css, kept in your collection's media folder (so it syncs with it) and rewritten whenever you save a group. Each note type pulls it in with a single @import url("_colorcoding_groups.css"); line at the top of its Styling, which the add-on adds the first time it colours a note of that type. Only the styling changes, so Anki does not ask for a full sync.

  • A colour change shows on the next card you review (the desktop caches a stylesheet for ten seconds); on AnkiDroid and AnkiMobile after the next sync.
  • Notes coloured by an earlier version (or by the original ColorCoding) carry style="color:…" inside each span. That keeps winning over the stylesheet until the note is coloured again: run color this deck's notes once per deck, or open the note with automatic colouring on. Both replace the old spans.
  • Uninstalling leaves the @import line behind. It is harmless (a missing stylesheet is ignored); delete the first line of a note type's Styling to tidy up. Spans left in notes show as plain text.
  • The add-on also puts the same rules into the editor itself, so coloured words show there too.

The same markup (class="ColorCoding", data-group) is what the original add-on wrote, so notes coloured by either version keep working.

Install

Anki 23.10 or newer (the add-on imports PyQt6 directly).

  1. Install from AnkiWeb (Tools β†’ Add-ons β†’ Get Add-ons…, code 267803161), or from a package built from this repo: git archive --format=zip -o colorcoding-groups.ankiaddon HEAD, then double-click the file. Or copy this folder into Anki's add-ons folder (Tools β†’ Add-ons β†’ View Files) as colorcoding_groups/.
  2. Restart Anki. A 🎨 Color Coding 🌈 entry appears under Tools.

The original ColorCoding add-on adds the same menu entry and hooks, so only one can run: installing this one disables the original automatically (its manifest.json lists it under conflicts). Your words and groups live in each add-on's own user_files/config.json, so to carry them over copy the original's file into this add-on's user_files/ (Tools β†’ Add-ons β†’ select β†’ View Files). The old flat format is upgraded on first load.

Your data

Words and groups live in user_files/config.json inside the add-on folder (created on first save, ignored by git). user_files/config.example.json shows the format:

{
  "groups":  {"Places": {"color": "#798aff", "bold": false}},
  "entries": [{"word": "Paris", "group": "Places"}]
}

Tools β†’ Color Coding β†’ Modify Manually edits this JSON in a text box. Entries without a group, or whose group no longer exists, are not coloured.

Development

  • Unit tests (no Anki needed): python3 -m unittest discover -s tests. The word matching, stylesheet and @import handling live in colorize.py; the colour suggestion maths (travelling-salesman tour, proportional hues, OKLCH) in palette.py; the OpenAI-compatible client in embeddings.py (tested against a real HTTP server on localhost). None of them imports anything from Anki.
  • Checks in a real Anki: python3 tools/check_in_anki.py runs the add-on in a throwaway profile (editor, bulk colouring and undo, deck scope, what the reviewer renders, the colour suggestion dialog against a fake embeddings server). --addon-folder 267803161 repeats it the way AnkiWeb installs it. COLORCODING_CHECK_TLS=1 also checks that Anki's own Python can reach api.openai.com over https (it sends nothing but a dummy word, without a key).
  • Releasing (maintainer): DESCRIPTION.md is the AnkiWeb listing's text; python3 tools/release_ankiweb.py checks, packages and publishes the committed tree plus that text, then verifies what AnkiWeb serves (--dry-run, --check; needs Firefox with the FoxMCP extension).
  • Screenshots: python3 tools/make_screenshots.py. python3 tools/check_harness.py proves the two above fail fast and clean (with a message and snapshots, no leftover processes) instead of hanging when Anki misbehaves.

Credits and licence

This add-on started from ColorCoding by Marc Schubert (Β© 2022–2024), published on AnkiWeb and GitHub, and still contains parts of his code (notably in changer_static.js and the settings window). The original project does not publish a licence, so those parts remain his; his copyright lines are kept in the source files. Everything added here (groups, group manager and picker, context menu, all-fields colouring, config migration, the shared stylesheet, deck-wise colouring, colour suggestions) is under the MIT licence.

If you are the original author and would like something changed or removed, please open an issue.