Skip to content

Commit

Permalink
combine common processing into a color-to-hex-string
Browse files Browse the repository at this point in the history
  • Loading branch information
cxxxr committed Jul 29, 2024
1 parent b2eeea0 commit 5a403d4
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 7 deletions.
6 changes: 1 addition & 5 deletions extensions/color-preview/color-preview.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,7 @@
(move-to-position start start-pos)
(move-to-position end end-pos)
(delete-between-points start end)
(insert-string start
(format nil "#~2,'0X~2,'0X~2,'0X"
(color-red color)
(color-green color)
(color-blue color)))
(insert-string start (color-to-hex-string color))
(scan-color-in-window window)))))))))

(define-overlay-accessors color-ovelray
Expand Down
2 changes: 1 addition & 1 deletion extensions/lisp-mode/eval.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
(hsv-to-rgb h
s
(+ v (if (< v 50) 5 -5)))
(format nil "#~2,'0X~2,'0X~2,'0X" r g b)))))
(color-to-hex-string (make-color r g b))))))

(defun display-evaluated-message
(start
Expand Down
2 changes: 1 addition & 1 deletion src/highlight-line.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
(hsv-to-rgb h
s
(max 0 (- v 2)))
(format nil "#~2,'0X~2,'0X~2,'0X" r g b))))))
(color-to-hex-string (make-color r g b)))))))

0 comments on commit 5a403d4

Please sign in to comment.