emacs customize-face color - emacs

I tried to customize my emacs color by changing font-lock faces' color (M-x customize-face).
But I found that the amount of color is not as many as all the values #xxxxxx.
For example, when changing a color value from #000000 to #FF0000, I just got only two color, 'red' and a 'lighter red'.
Is this the limit of emacs or I need to use another way to express color value?

Apparently a Windows shell doesn't support colors. Either get a modern shell or run in Window mode.

Related

How do I change the background color of the folded block in vscode?

After folding a block, it is marked with a different background color.
How to make this color equal to the basic color of the editor's background?
enter image description here
You have two options. If you want to tweak the colors used for the folded area background, use this in your settings:
"workbench.colorCustomizations": {
"editor.foldBackground": "#ff000000"
}
Rather than trying to match your editor background you could just make it transparent as I did above. The last two digits of the hex color are for opacity.
See in general https://code.visualstudio.com/api/references/theme-color
Easier is to just disable folding highlighting in the regular settings:
Editor > Folding Highlight

How can I write colored text to an IRC channel with Irssi?

I'm searching for a method to write a text with different colors like I always saw on other IRC channels. I want to achieve this with Irssi which is CLI based. I have found multiple methods which didn't work as expected. How can I for example write
WHAT
with green color for example?
I would like to achieve the same effect from a simple Bash script too.
First, make sure to enable text colors with
/set hide_colors OFF
Within Irssi, to answer your concrete question, type
Ctrl+C 3 WHAT
and then Enter. The text will show up in green. This convention is known as mIRC colour codes. To make it more comfortable, download the colour_popup script, place it in your ~/.irssi/scripts/autorun folder and run this command:
/statusbar prompt add -after input -alignment right colours
Then it will show you the available colours once you type Ctrl + C.
On the other hand with Bash, you need to use ANSI colour codes. To output green text, try this command:
printf "\e[%dm%s\e[m\n" 32 hallo
\e[ is a CSI (terminal control sequence start) and m is the command; it means character graphics attributes like colour, bold, ...
3 refers to the dull foreground colour table, 2 is green; valid colours go from 0-7. Bright colours are 90-97; background colours are 40-47 and 100-107. There are even more colours possible with other encodings, such as 256 colour table "38;5;<idx>" where <idx> is from 0-255, or 24 bit RGB colours "38;2;12;34;56" (12/255 red, 34/255 green, 56/255 blue); this is not supported by all terminals.

Emacs lisp: get RGB components of face?

I've recently made a switch to Emacs trunk and the region face
color was changed.
And I can't change it back without knowing what it was before.
So I've launched emacs24.3 and see that it was "gtk_selection_bg_color".
This color name isn't valid any more in the trunk.
I've found the color to be "f9b593" with screenshot->gimp->eyedrop method,
but I'd like to know how to do this in Elisp, e.g. something like
(get-face-background-rgb 'region)
;; "f9b593"
Any suggestions?
You can use color-value:
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.
To get the color of a face, you can use face-foreground and face-background. In your case, you can use:
(color-values (face-background 'region))
You can use library eyedropper.el or library palette.el --- see Color Palette --- to get the color of a face at point. And you can use library palette to explore colors, to come up with a similar but slightly different color etc. You can use library hexrgb.el to examine and modify RGB components of colors.

Trying to figure out how to force Aquamacs (or any windowed Emacs) to use the xterm 256-colors

This question is in regards to forcing emacs to use a 256 color xterm color scheme.
When you open emacs in a terminal that supports xterm-256, it defaults to the xterm-256 color scheme, where default emacs font face colors like 'Firebrick' turns into something the xterm color scheme can display, which in this case is 'Red', so on and so forth. I really like this. I do not like the default emacs colors in a non-terminal setting; I think they are too faded and washed out-- I much prefer the brightness of the terminal colors.
(In fact I find myself programming in the terminal most often simply because I vastly prefer the typeface and the colors-- but I'd like to start using Aquamacs more for various reasons.)
For the life of me, I cannot figure out how to force Emacs (or in my case, Aquamacs) to force itself to downgrade the default color scheme to the xterm 256 color scheme like it does in my terminal. There has to be an easier way than making a new, ridiculously detailed color theme, but beyond the "TERM= " command you can set in your bashrc file (which obviously Aquamacs doesn't care about or use) I can't find anything equivalent in Emacs/Aquamacs that tells it to adopt a 256 color range so that it does things like turns Firebrick into the closest 'available' color, in this case, red.
I've attached screenshots. The first is how I want it to look like. (jpeg ruins the cripsness/brightness of the colors, but you get the idea.)
Second shot here is the default 'washed out' colors in aquamacs. See how the comments are in Firebrick (correctly displayed), versus the bright red of the comments in the above pic.
Variable names show up as more yellow in the top pic, but as more 'brown' in the bottom. Strings in the above file show up as more 'light brown' whereas in the bottom, it's more a dark brown. You can see they are definitely the same color scheme-- it's just that the terminal doesn't know about some of the colors and so it converts them to their baser, brighter forms.
Anybody know how to force this in Aquamacs? I've spent far too many hours researching this. :-)
Thanks!
Nick

How to darken postscript text produced by emacs

I'm using emacs command ps-spool-buffer-with-faces command to make some postscript files of code I'm working on. The problem is that the font color seems to be light gray instead of black. I've poked around the postscript file & googled a bit, but have not found any solution. Does anyone know how to turn my gray font black?
Assuming you just want to print in black and white, try:
(setq ps-print-color-p nil)
Otherwise, you might take a look at other values for ps-print-color-p:
ps-print-color-p is a variable defined in `ps-print.el'.
Its value is t
Documentation:
Specify how buffer's text color is printed.
Valid values are:
nil Do not print colors.
t Print colors.
black-white Print colors on black/white printer.
See also `ps-black-white-faces'.
Any other value is treated as t.
You can customize this variable.
You can customize using M-xcustomize-variableRETps-print-color-pRET