XCOLORS(1)

πŸ“¦
version 1.5a Β· 4 versions
, in debian trixie, ubuntu noble, ubuntu questing

πŸ’… XCOLORS β€” the xcolors page, bestie edition

okay so this is the manual for xcolors, a lil X11 program that shows you every color name your X server knows about. it lives in the General Commands Manual section (that's section 1, iykyk). grab a snack, we're going through the whole thing together πŸ“


✨ NAME ✨

xcolors β€” display all X11 color names and colors

like. it shows you the names AND the actual colors. both. iconic behavior fr.


🌈 SYNOPSIS 🌈

xcolors [ -start color ] [ -near color ] [ -distance howfar ]

that's the whole vibe. three optional flags, no positional args, we love a low-maintenance queen πŸ‘‘


πŸ’– DESCRIPTION πŸ’–

so what xcolors does is read the rgb.txt file β€” that's the file that defines all the color names the X server knows about β€” and then it displays the colors found. that's it. that's the whole thing. and honestly? slay.

At the top of the window there's a sample region containing text. like a little preview box, bestie. By clicking on the color names, the color of the sample text can be changed. so you click a color name, the sample text recolors itself, you go "ooooh" πŸ’…

Mouse button 1 changes the foreground; button 2 changes the background. (button 3 is just standing there, minding its business, no cap.)

The text can also be edited! not just looked at. you can type in it. main character energy.

Typing `q` exits the program. lowercase q. that's your escape hatch πŸšͺ✨


πŸŽ€ OPTIONS πŸŽ€

In addition to the usual X Toolkit options, xcolors understands these command line options:

  • -start name β€” specify a color name to start with; colors before this one in the rgb.txt file are skipped. This option is useful if there are more colors than will fit on your screen or in your colormap. (which, honestly, is a LOT of colors, so this is your little filter bestie 🫢)
  • -rgbfile filename β€” specify an alternate color database file to read. want to use a different color list? go off, be your own person.
  • -near nearcolor β€” only show colors near this one in the RGB space. All colors within a sphere in the RGB-space centered on nearcolor are displayed. yes, a sphere. in RGB space. geometry said gay rights 🌐
  • -distance howfar β€” defines how close colors have to be to nearcolor to be displayed. This option sets the radius of the sphere used by the -near option. The scale is such that the RGB cube is 256 units on a side. The default is 64.

πŸ”₯ ACTIONS πŸ”₯

these are the toolkit actions, for when you're out here writing your own resources and translations like a boss:

  • set-foreground([color]) β€” Set the foreground color of the sample region. If no color is provided, the color is taken from the border color of the widget where the action occurred.
  • set-background([color]) β€” Same as set-foreground() but sets the background color. (it's the same girl, different era πŸ’œ)
  • quit() β€” Exit xcolors. bye bestie πŸ‘‹

🌸 RESOURCES 🌸

Xcolors has a few top-level application resources that allow customizations that are specific to xcolors. so like, the glow-up options, but in your resource file:

  • startColor (class StartColor) β€” See the -start option.
  • rgbFile (class RgbFile) β€” See the -rgbfile option.
  • nearColor (class NearColor) β€” See the -near option.
  • nearDistance (class NearDistance) β€” See the -distance option.

πŸ¦‹ WIDGET HIERARCHY πŸ¦‹

Knowing the name and position in the hierarchy of each widget is useful when specifying resources for them. In the chart below, the class and name of each widget is given. so if you want to target ONE specific lil widget, this is your map πŸ—ΊοΈβœ¨

Xcolors xcolors
     Paned panes
          AsciiText sample
          Viewport viewport
               Box colors
                    Label colorname
                    Label colorname
                    .
                    .
                    .

see those dots at the bottom? yeah. it just keeps going. one Label colorname per color. it's giving infinite scroll before infinite scroll was a thing 😭


🧚 FILES 🧚

  • /etc/X11/rgb.txt β€” X color names and values. the sacred text. the source of truth. the girlies' bible πŸ“–πŸ’–

πŸ’€ BUGS πŸ’€

okay bestie, sit down, we gotta talk about the flaws. not me defending them, just reporting:

  • Assumes that all names for the same color are consecutive in the rgb.txt file. so if your color file is chaotic and scattered? it's not gonna vibe with that.
  • Because xcolors cannot read the server's color name database, the color names it uses may not match those in the server. This is most likely to happen if xcolors is run from a remote host. so like, remote host shenanigans = name mismatch potential. watch out 🫠
  • The program would be faster if it used gadgets instead of widgets for the color spots. yeah. it's a little slow. it's doing its best. it's still cute though.
ngl these are real and documented, not me being dramatic. the manpage said it, I'm just saying it with more emoji. periodt.

πŸ‘‘ AUTHOR πŸ‘‘

Stephen Gildea, MIT X Consortium β€” the actual legend who wrote this. respect the architect πŸ«‘πŸ’œ


and that's the whole page, bestie!! this came from X Version 11, dated 3 October 1991 β€” yeah, she's an elder icon and she's still serving colors πŸŒˆπŸ’… stay colorful, don't let anyone tell you your colormap is too big πŸ’–βœ¨

πŸ“¦ where this page comes from