I want to set the foreground colours for outlines using a list stored in pigment-darkbg
. How can I do this in a neat and short way ?
(defun outline-tyface ()
(interactive)
(let ( (pigment-darkbg
[ "#4fafff" "#4fe42f" "#fe6060" "#f0dd60"
"#ff62d4" "#3fdfd0" "#fba849" "#9f80ff" ]) )
(set-face-foreground 'outline-1 "#4fafff")
(set-face-foreground 'outline-2 )
(set-face-foreground 'outline-3 )
(set-face-foreground 'outline-4 )
(set-face-foreground 'outline-5 )
(set-face-foreground 'outline-6 )
(set-face-foreground 'outline-7 )
(set-face-foreground 'outline-8 )))
dolist
(as @db48x showed) you'll need to usewhile
or equivalent, and usearef
to access the iterated indexed vector element.i iteration
. Andi iteration over vector or string
tells you aboutseq-doseq
, which is likedolist
but works also for a vector or string.