2022-11-28 22:12:01 +00:00
|
|
|
(deftheme my-theme)
|
|
|
|
|
|
|
|
(let* (;; Helper functions
|
|
|
|
(face (lambda (face &rest args)
|
|
|
|
(let ((build-face #'(lambda (termspec type args)
|
|
|
|
(append `(,termspec)
|
|
|
|
(if (plist-get args :fg) (if (nth type (plist-get args :fg))
|
|
|
|
`(:foreground ,(nth type (plist-get args :fg)))))
|
|
|
|
(if (plist-get args :bg) (if (nth type (plist-get args :bg))
|
2023-06-14 17:56:28 +00:00
|
|
|
`(:background ,(nth type (plist-get args :bg)))))
|
|
|
|
(if (plist-member args :italic) '(:slant italic))))))
|
2022-11-28 22:12:01 +00:00
|
|
|
`(,face
|
2023-06-30 15:58:30 +00:00
|
|
|
,`(
|
|
|
|
,(funcall build-face '((min-colors 0)) 0 args)
|
|
|
|
;;,(funcall build-face '((min-colors 256)) 0 args)
|
|
|
|
;;,(funcall build-face '((min-colors 8)) 1 args)
|
|
|
|
)
|
|
|
|
))))
|
2022-11-28 22:12:01 +00:00
|
|
|
(color-join (lambda (list)
|
|
|
|
(format "#%02x%02x%02x"
|
|
|
|
(ash (nth 0 list) -8)
|
|
|
|
(ash (nth 1 list) -8)
|
|
|
|
(ash (nth 2 list) -8))))
|
|
|
|
(color-blend (lambda (c1 c2 alpha)
|
|
|
|
(let ((blend (lambda (a b alpha)
|
|
|
|
(round (+
|
|
|
|
(* a alpha)
|
|
|
|
(* b (- 1 alpha)))))))
|
|
|
|
`(,(funcall blend (nth 0 c1) (nth 0 c2) alpha)
|
|
|
|
,(funcall blend (nth 1 c1) (nth 1 c2) alpha)
|
|
|
|
,(funcall blend (nth 2 c1) (nth 2 c2) alpha)))))
|
|
|
|
(blend (lambda (c1 c2 alpha)
|
|
|
|
(funcall color-join
|
|
|
|
(funcall color-blend
|
|
|
|
(color-values c1)
|
|
|
|
(color-values c2)
|
|
|
|
alpha))))
|
|
|
|
(darken (lambda (color amount)
|
|
|
|
(funcall blend
|
|
|
|
"#000000"
|
|
|
|
color
|
|
|
|
amount)))
|
|
|
|
(brighten (lambda (color amount)
|
|
|
|
(funcall blend
|
|
|
|
"#ffffff"
|
|
|
|
color
|
|
|
|
amount)))
|
|
|
|
(darken-first (lambda (color amount)
|
|
|
|
(append
|
|
|
|
`(,(funcall darken (car color) amount))
|
|
|
|
(cdr color))))
|
|
|
|
(brighten-first (lambda (color amount)
|
|
|
|
(append
|
|
|
|
`(,(funcall brighten (car color) amount))
|
|
|
|
(cdr color))))
|
2023-01-18 01:11:30 +00:00
|
|
|
;; name full 8
|
|
|
|
(common-fg '("#b7c9ee" "white"))
|
|
|
|
(common-bg '("#0d1017" "black"))
|
|
|
|
(modeline '("#156570" "white"))
|
2022-12-01 10:29:19 +00:00
|
|
|
(highlight (funcall brighten-first common-bg 0.15))
|
2023-01-18 01:11:30 +00:00
|
|
|
(comment '("#42767d" "red"))
|
|
|
|
(doc '("#6a866f" "red"))
|
|
|
|
(keyword '("#349672" "cyan"))
|
|
|
|
(preprocessor '("#5ca9af" "cyan"))
|
|
|
|
(function '("#5fc995" "white"))
|
|
|
|
(variable '("#6ec5b1" "white"))
|
|
|
|
(string '("#15e04a" "green"))
|
|
|
|
(type '("#17b343" "white"))
|
2022-12-01 06:57:41 +00:00
|
|
|
|
|
|
|
(lsp-hover-highlight (funcall brighten-first common-bg 0.05))
|
|
|
|
(company-bg (funcall brighten-first common-bg 0.1))
|
2022-12-01 10:29:19 +00:00
|
|
|
|
2023-01-18 01:11:30 +00:00
|
|
|
(peek-code '("#0e151a" nil))
|
2022-11-28 22:12:01 +00:00
|
|
|
;; Extra colors #1fa345
|
|
|
|
)
|
|
|
|
(custom-theme-set-faces
|
|
|
|
'my-theme
|
|
|
|
(funcall face 'default :fg common-fg :bg common-bg)
|
|
|
|
(funcall face 'cursor :bg common-fg)
|
|
|
|
(funcall face 'line-number-current-line :fg common-fg)
|
|
|
|
(funcall face 'line-number :fg (funcall darken-first common-fg 0.25))
|
|
|
|
(funcall face 'mode-line-inactive :bg (funcall darken-first common-bg 0.35) :fg common-fg)
|
|
|
|
(funcall face 'mode-line :bg modeline :fg common-fg)
|
|
|
|
(funcall face 'hl-line :bg (funcall darken-first common-bg 0.15))
|
2023-02-22 02:48:44 +00:00
|
|
|
(funcall face 'highlight :bg highlight)
|
2022-12-01 10:29:19 +00:00
|
|
|
(funcall face 'region :bg highlight)
|
2022-11-28 22:12:01 +00:00
|
|
|
(funcall face 'font-lock-comment-face :fg comment)
|
|
|
|
(funcall face 'font-lock-doc-face :fg doc)
|
|
|
|
(funcall face 'font-lock-keyword-face :fg keyword)
|
|
|
|
(funcall face 'font-lock-preprocessor-face :fg preprocessor)
|
|
|
|
(funcall face 'font-lock-function-name-face :fg function)
|
|
|
|
(funcall face 'font-lock-variable-name-face :fg variable)
|
2023-06-14 17:56:28 +00:00
|
|
|
(funcall face 'font-lock-property-name-face :fg variable :italic)
|
2022-11-28 22:12:01 +00:00
|
|
|
(funcall face 'font-lock-string-face :fg string)
|
|
|
|
(funcall face 'font-lock-type-face :fg type)
|
2022-12-01 06:57:41 +00:00
|
|
|
|
|
|
|
;; Lsp
|
|
|
|
(funcall face 'lsp-face-highlight-textual :bg lsp-hover-highlight)
|
|
|
|
(funcall face 'lsp-face-highlight-read :bg lsp-hover-highlight)
|
|
|
|
(funcall face 'lsp-face-highlight-write :bg lsp-hover-highlight)
|
|
|
|
|
2022-12-01 10:29:19 +00:00
|
|
|
(funcall face 'lsp-ui-peek-filename :fg common-fg)
|
|
|
|
(funcall face 'lsp-ui-peek-header :bg modeline)
|
|
|
|
(funcall face 'lsp-ui-peek-peek :bg peek-code)
|
|
|
|
(funcall face 'lsp-ui-peek-list :bg peek-code)
|
|
|
|
(funcall face 'lsp-ui-peek-selection :bg highlight)
|
|
|
|
(funcall face 'lsp-ui-peek-highlight :bg highlight)
|
|
|
|
|
|
|
|
;; Company
|
2022-12-01 06:57:41 +00:00
|
|
|
(funcall face 'company-tooltip :bg company-bg)
|
|
|
|
(funcall face 'company-tooltip-selection :bg (funcall brighten-first company-bg 0.15))
|
|
|
|
(funcall face 'company-scrollbar-fg :bg (funcall brighten-first company-bg 0.3))
|
|
|
|
(funcall face 'company-scrollbar-bg :bg (funcall brighten-first company-bg 0.15))
|
2022-11-28 22:12:01 +00:00
|
|
|
))
|
|
|
|
|
|
|
|
(provide-theme 'my-theme)
|