Last active
February 14, 2017 15:46
-
-
Save cxxxr/8066b4b7b250331120f9beca0069fa80 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(in-package :lem-user) | |
(define-command list-colors-display () () | |
(let* ((buffer (get-buffer-create "*colors*")) | |
(p (buffer-point buffer))) | |
(switch-to-buffer buffer) | |
(erase-buffer buffer) | |
(dolist (color (reverse lem.term::*colors*)) | |
(let ((attribute (make-attribute (lem.term::color-name color) nil))) | |
(with-point ((s p)) | |
(insert-string p (lem.term::color-name color)) | |
(move-to-column p (+ 20 (point-charpos s)) t) | |
(put-text-property s p :attribute attribute))) | |
(insert-string p " ") | |
(let ((attribute (make-attribute (lem.term::color-name color) nil :reverse-p t))) | |
(with-point ((s p)) | |
(insert-string p (lem.term::color-name color)) | |
(move-to-column p (+ 20 (point-charpos s)) t) | |
(put-text-property s p :attribute attribute)) | |
(insert-string p " ") | |
(insert-string p (format nil "#~2,'0X~2,'0X~2,'0X" | |
(lem.term::color-r color) | |
(lem.term::color-g color) | |
(lem.term::color-b color))) | |
(insert-character p #\newline))) | |
(buffer-start p))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment