(defn color [x]
(str "oklch(70% 20%" (hash x) ")"))
hash
function to generate an integer, and use it in place of hue(defn color [x] (str "oklch(50% 70% " (hash x) ")"))
(def tags ["this" "is" "a" "quick" "demo"])
(defn demo
[]
[:div {:style {:display "flex"
:gap "0.5em"}}
(for [tag tags]
[:div {:style {:color (color tag)}}
"#"
tag])
(for [tag tags]
[:div {:style {:background-color (color tag)
:color "white"
:padding "0.1em 0.25em"
:border-radius "0.25em"}}
tag])])
(require '[reagent.dom :as rdom])
(rdom/render [demo] (.getElementById js/document "demo"))