diff --git a/oni-org/oni-org.el b/oni-org/oni-org.el index 5a65b26..1416060 100644 --- a/oni-org/oni-org.el +++ b/oni-org/oni-org.el @@ -4,7 +4,7 @@ ;; Author: Tom Willemse ;; Keywords: local -;; Version: 2023.0108.154251 +;; Version: 2023.0224.232539 ;; Package-Requires: (oni-yasnippet oni-alert oni-hydra org org-contrib org-bullets org-edna diminish all-the-icons olivetti form-feed) ;; This program is free software; you can redistribute it and/or modify @@ -35,6 +35,7 @@ ;;; Code: +(require 'color) (require 'diminish) (require 'hydra) (require 'ob) @@ -251,8 +252,10 @@ located at the start of the line." (find-file (oni-org-expand-to-home "documents/gtd/index.org"))) (defun oni-org-color-for (object) - "Generate a hex color by taking the first 6 characters of OBJECT’s MD5 sum." - (format "#%s" (substring (md5 object) 0 6))) + "Generate a color for OBJECT by using its hash as a parameter for an LCh color." + (apply #'color-rgb-to-hex + (apply #'color-lab-to-srgb + (color-lch-to-lab 65 30 (mod (sxhash-equal object) 360))))) (defun oni-org-generate-todo-keyword-faces () "Create faces for all todo keywords in the current buffer."