Skip to content

Fix for org-rainbow-tags (12-digit color codes)#59

Open
mtekman wants to merge 2 commits into
emacsorphanage:masterfrom
mtekman:org-rainbows-fix
Open

Fix for org-rainbow-tags (12-digit color codes)#59
mtekman wants to merge 2 commits into
emacsorphanage:masterfrom
mtekman:org-rainbows-fix

Conversation

@mtekman

@mtekman mtekman commented Nov 29, 2025

Copy link
Copy Markdown

org-rainbow-tags is a package which autogenerates some nice looking color overlays for org-mode tag names.

However, face names use strings instead of symbols (causing htmlize-face-to-fstruct to detect no color at the face at point), and uses 12-digit color codes which Emacs renders fine but CSS does not (hence the fix to htmlize-color-to-rgb).

This PR adds a general fix for quoted face names, and truncates long color hexes into CSS colors.

htmlize.el: htmlize-color-to-rgb, htmlize-face-to-fstruct, htmlize--truncate-hex

Added some small fixes relating org-rainbow-tags which uses strings for tagnames instead of symbols, and 12-digit color codes.

* htmlize-face-to-fstruct: Sets string faces to symbols
* htmlize-color-to-rgb: Update the regex for readability, truncate hex if longer than 9 characters, assuming 8-digit rrggbbaa css colors are fine.
* htmlize--truncate-hex: New function that converts an arbitrary long color hex to a normal 6 digit hex

…runcate-hex

Added some small fixes relating org-rainbow-tags which uses strings
for tagnames instead of symbols, and 12-digit color codes.

* htmlize-face-to-fstruct: Sets string faces to symbols
* htmlize-color-to-rgb: Update the regex for readability, truncate hex
if longer than 9 characters, assuming 8-digit rrggbbaa css colors are
fine.
* htmlize--truncate-hex: New function that converts an arbitrary long
color hex to a normal 6 digit hex
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant