gpt4 book ai didi

Emacs 口齿不清 : get RGB components of face?

转载 作者:行者123 更新时间:2023-12-03 09:25:50 25 4
gpt4 key购买 nike

我最近切换到 Emacs trunk 和 region 界面颜色改变了。而且我无法在不知道它之前是什么的情况下将其改回来。

所以我启动了 emacs24.3 并看到它是“gtk_selection_bg_color”。该颜色名称在后备箱中不再有效。我发现颜色是“f9b593”,用截图->gimp->eyedrop方法,但我想知道如何在 Elisp 中执行此操作,例如类似的东西

(get-face-background-rgb 'region)
;; "f9b593"

有什么建议吗?

最佳答案

您可以使用颜色值:

color-values is a compiled Lisp function in `faces.el'. (color-values COLOR &optional FRAME)

Return a description of the color named COLOR on frame FRAME. The value is a list of integer RGB values--(RED GREEN BLUE). These values appear to range from 0 to 65280 or 65535, depending on the system; white is (65280 65280 65280) or (65535 65535 65535). If FRAME is omitted or nil, use the selected frame. If FRAME cannot display COLOR, the value is nil. If COLOR is the symbol `unspecified' or one of the strings "unspecified-fg" or "unspecified-bg", the value is nil.

要获取脸部的颜色,您可以使用face-foregroundface-background。根据您的情况,您可以使用:

 (color-values (face-background 'region))

关于Emacs 口齿不清 : get RGB components of face?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21573696/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com