CMAP(5)
π CMAP β like, the whole vibe of .cmap files (color maps) π¨
okay bestie, sit down, hydrate, and let's talk about color maps because this one is actually so satisfying once it clicks. β¨
π NAME π
cmap β the format of .cmap files, aka color maps. that's it, that's the name, we move.
π¦ DESCRIPTION π¦
so. color-map files define the mapping between eight-bit color numbers and the red, green and blue intensities used for those numbers. basically: "this number β this exact shade." the glow-up pipeline. π
Magic reads these files as part of system startup, and also when you use the :load and :save commands in color-map windows. so they're not just decorative, they're load-bearing, no cap.
Color-map file names usually look like x.y.z.cmapn, and every single letter is doing a job:
xβ a class of technology filesyβ a class of displayszβ a class of monitorsnβ a version number (currently1)
that version number will change in the future if the format of color-map files ever changes. so like, don't hardcode your whole personality to n = 1, yk? normally x and y correspond to the corresponding parts of a display styles file.
for example: the color map file mos.7bit.std.cmap1 is used today for most nMOS and CMOS technology files using displays that support at least seven bits of color per pixel and standard-phosphor monitors. and it corresponds to the display styles file mos.7bit.dstyle5. see how they match? that's not a coincidence bestie, that's a system. π
π the actual file format π
Color-map files are stored in ASCII form, and each line has four decimal integers separated by white space. the first three integers are red, green, and blue intensities, and the fourth field is a color number. so it's giving:
<red> <green> <blue> <color-number>
for current displays the intensities must be integers between 0 and 255. that range is not a suggestion, that's the whole entire rule. π¨
and the color numbers must increase from line to line, and the last line must have a color number of 255. non-negotiable.
here's the part that's lowkey the best once you get it β the intensities on the first line are used for all colors from 0 up to and including the color number on that line. for every other line, the intensities on that line are used for all colors starting one color above the color number on the previous line and continuing up and through the color number on the current line. so each line is like "from just after the last cutoff, all the way to me." ranges, but make it fashion. πΈ
for example, consider the color map below:
255 0 0 2
0 0 255 3
255 255 255 256
this color map indicates that colors 0, 1, and 2 are to be red, color 3 is to be blue, and all other colors are to be white. slay. π€
π SEE ALSO π
π«Ά quick vibe check before you go: the file names, the integers, the ranges, the 255 β all of it is exact. i'm cute but i'm not creative with your spec. π
okay that's the page!! this one came from the 4th Berkeley Distribution, and it's the CMAP(5) page β go forth and map your colors, you absolute icon. πππ¦
π¦ where this page comes from
- debian bookworm: magic 8.3.105+ds.1-1.1 Β· BSD-style
- fedora 43: magic 8.3.552-1.fc43 Β· HPND-UC-export-US AND TCL AND HPND
- fedora 43: magic 8.3.651-1.fc43 Β· HPND-UC-export-US AND TCL AND HPND
- fedora 44: magic 8.3.623-1.fc44 Β· HPND-UC-export-US AND TCL AND HPND
- fedora 44: magic 8.3.684-1.fc44
- fedora 44: magic 8.3.685-1.fc44 Β· HPND-UC-export-US AND TCL AND HPND
- nixos 26.05: magic-vlsi 8.3.629
- nixpkgs unstable: magic-vlsi 8.3.689
- ubuntu jammy: magic 8.3.105+ds.1-1.1 Β· BSD-style
- ubuntu noble: magic 8.3.105+ds.1-1.1 Β· BSD-style
- ubuntu resolute: magic 8.3.105+ds.1-1.1 Β· BSD-style
- ubuntu stonking: magic 8.3.105+ds.1-1.1 Β· BSD-style
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms