|
| 1 | +This is an overview of the color capabilities of skin files. |
| 2 | + |
| 3 | +See the FAQ for instructions on setting up 256 color or truecolor support in |
| 4 | +your terminal. |
| 5 | + |
| 6 | + |
| 7 | +Color definitions |
| 8 | +----------------- |
| 9 | + |
| 10 | +Keywords defining the colors and attributes to be used in a certain context |
| 11 | +have the following syntax: |
| 12 | + |
| 13 | +Color definitions have the syntax of |
| 14 | + |
| 15 | + keyword = foreground_color;background_color;attributes |
| 16 | + |
| 17 | +Omitted values fall back to the section's "_default_", or in turn to the |
| 18 | +"[core]" section's "_default_". |
| 19 | + |
| 20 | + |
| 21 | +Legacy 16 color mode |
| 22 | +-------------------- |
| 23 | + |
| 24 | +If you aim for the highest compatibility with terminals, you should restrict |
| 25 | +your skin to the standard 16 colors. These colors each have two names: the |
| 26 | +preferred human-friendly one, and a technical one referring to their color |
| 27 | +index. |
| 28 | + |
| 29 | + black = color0 gray = color8 |
| 30 | + red = color1 brightred = color9 |
| 31 | + green = color2 brightgreen = color10 |
| 32 | + brown = color3 yellow = color11 |
| 33 | + blue = color4 brightblue = color12 |
| 34 | + magenta = color5 brightmagenta = color13 |
| 35 | + cyan = color6 brightcyan = color14 |
| 36 | + lightgray = color7 white = color15 |
| 37 | + |
| 38 | +With 8 color terminal settings (such as TERM=linux or TERM=xterm), bright |
| 39 | +foreground colors (second column) are emulated in mc by enabling the bold |
| 40 | +attribute, and the colors are mapped to their darker counterpart (first |
| 41 | +column). In turn, the terminal may (or may not) interpret the bold flag as |
| 42 | +brighter foreground color, thus reverting to the originally specified bright |
| 43 | +foreground. |
| 44 | + |
| 45 | +Even in terminals that support more colors (such as TERM=xterm-256color), the |
| 46 | +first 8 foreground colors combined with the bold attribute might be converted |
| 47 | +to their brighter counterpart. This depends on choice of the terminal or a |
| 48 | +setting thereof, mc having no control over it. |
| 49 | + |
| 50 | +Plus, the exact color values heavily depend on the user's chosen palette. |
| 51 | + |
| 52 | +For all these reasons, a skin using these colors can look quite different |
| 53 | +across systems. |
| 54 | + |
| 55 | + |
| 56 | +256 color extension |
| 57 | +------------------- |
| 58 | + |
| 59 | +Almost all graphical terminal emulators support the 256 color extension. |
| 60 | + |
| 61 | +By adding "256colors = true" to the "[skin]" section, you get access to 240 |
| 62 | +additional colors (a 6x6x6 color cube and a 24 color grayscale ramp) on top of |
| 63 | +the standard 16. |
| 64 | + |
| 65 | +Colors of the 6x6x6 cube are called "rgb000" to "rgb555", all three digits |
| 66 | +ranging from 0 to 5, corresponding to the R, G and B color components. |
| 67 | +Alternatively, you can use their technical color index: "color16" to |
| 68 | +"color231". |
| 69 | + |
| 70 | +Colors of the grayscale ramp are "gray0" to "gray23", or "color232" to |
| 71 | +"color255". |
| 72 | + |
| 73 | +There are scripts available that display these colors in the terminal (e.g. |
| 74 | +"256colors2.pl" shipped in Xterm's source code), as well as web pages showing |
| 75 | +them (e.g. https://www.ditig.com/256-colors-cheat-sheet). |
| 76 | + |
| 77 | + |
| 78 | +Truecolor extension |
| 79 | +------------------- |
| 80 | + |
| 81 | +A wide range of terminals support the truecolor extension. |
| 82 | + |
| 83 | +By adding "truecolors = true" to the "[skin]" section (instead of the |
| 84 | +"256colors" keyword), you get access to 2^24 (about 16 million) direct colors |
| 85 | +on top of the 256 palette ones. |
| 86 | + |
| 87 | +Truecolors are referred to by the standard "#rrggbb" or "#rgb" notation. The |
| 88 | +short form is interpreted by repeating each hex digit, e.g. "#5AF" is a |
| 89 | +shorthand for "#55AAFF". |
| 90 | + |
| 91 | + |
| 92 | +Attributes |
| 93 | +---------- |
| 94 | + |
| 95 | +The third value can specify special attributes to apply. Supported attributes |
| 96 | +are: |
| 97 | + |
| 98 | + bold |
| 99 | + underline |
| 100 | + italic |
| 101 | + reverse |
| 102 | + blink |
| 103 | + |
| 104 | +Append more with a plus sign, e.g. "bold+italic". |
| 105 | + |
| 106 | +Omitting the field makes it use the fallback value as described above. Use any |
| 107 | +unrecognized word (e.g. "none") to prevent fallback and disable all |
| 108 | +attributes. |
| 109 | + |
0 commit comments