Advertisement
Guest User

Untitled

a guest
Dec 4th, 2016
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.18 KB | None | 0 0
  1. (in-package :lem-user)
  2.  
  3. (defun list-colors-display ()
  4. (let ((buffer (get-buffer-create "*colors*")))
  5. (switch-to-buffer buffer)
  6. (buffer-erase buffer)
  7. (dolist (color (reverse lem.term::*colors*))
  8. (let ((attribute (make-attribute (lem.term::color-name color) nil))
  9. (point-start (current-point)))
  10. (insert-string (lem.term::color-name color))
  11. (move-to-column (+ 20 (point-charpos point-start)) t)
  12. (put-property point-start (current-point)
  13. :attribute attribute))
  14. (insert-string " ")
  15. (let ((attribute (make-attribute (lem.term::color-name color) nil :reverse-p t))
  16. (point-start (current-point)))
  17. (insert-string (lem.term::color-name color))
  18. (move-to-column (+ 20 (point-charpos point-start)) t)
  19. (put-property point-start (current-point)
  20. :attribute attribute))
  21. (insert-string " ")
  22. (insert-string (format nil "#~2,'0X~2,'0X~2,'0X"
  23. (lem.term::color-r color)
  24. (lem.term::color-g color)
  25. (lem.term::color-b color)))
  26. (insert-newline 1))
  27. (beginning-of-buffer)))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement