{"id":21981654,"url":"https://github.com/soft/xcolor","last_synced_at":"2025-05-16T00:03:42.432Z","repository":{"id":30751753,"uuid":"125900701","full_name":"Soft/xcolor","owner":"Soft","description":"Lightweight color picker for X11","archived":false,"fork":false,"pushed_at":"2024-07-10T13:44:01.000Z","size":607,"stargazers_count":474,"open_issues_count":21,"forks_count":23,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-05-09T06:12:59.132Z","etag":null,"topics":["cli","color","color-picker","design","kiss-principle","lightweight","linux","rust","x11","xcb"],"latest_commit_sha":null,"homepage":"https://soft.github.io/xcolor/","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Soft.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-03-19T18:10:35.000Z","updated_at":"2025-05-03T14:37:22.000Z","dependencies_parsed_at":"2024-08-01T16:39:50.126Z","dependency_job_id":"97b35fb5-e285-4806-97e1-c5686f2f2d75","html_url":"https://github.com/Soft/xcolor","commit_stats":{"total_commits":103,"total_committers":8,"mean_commits":12.875,"dds":0.1456310679611651,"last_synced_commit":"969d6525c4568a2fafd321fcd72a95481c5f3c7b"},"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Soft%2Fxcolor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Soft%2Fxcolor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Soft%2Fxcolor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Soft%2Fxcolor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Soft","download_url":"https://codeload.github.com/Soft/xcolor/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254442854,"owners_count":22071878,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cli","color","color-picker","design","kiss-principle","lightweight","linux","rust","x11","xcb"],"created_at":"2024-11-29T17:18:55.166Z","updated_at":"2025-05-16T00:03:40.842Z","avatar_url":"https://github.com/Soft.png","language":"Rust","readme":"# xcolor 🌈\n\n[![Build Status](https://api.travis-ci.org/Soft/xcolor.svg?branch=master)](https://travis-ci.org/Soft/xcolor)\n[![Latest Version](https://img.shields.io/crates/v/xcolor.svg)](https://crates.io/crates/xcolor)\n[![GitHub release](https://img.shields.io/github/release/Soft/xcolor.svg)](https://github.com/Soft/xcolor/releases)\n[![dependency status](https://deps.rs/repo/github/soft/xcolor/status.svg)](https://deps.rs/repo/github/soft/xcolor)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\n\u003cimg align=\"right\" width=\"250\" src=\"https://raw.githubusercontent.com/Soft/xcolor/master/extra/screenshot.png\"\u003e\n\nLightweight color picker for X11. Use mouse to select colors visible anywhere on\nthe screen to get their RGB representation.\n\n## Installation\n\n### Using Cargo\n\n`xcolor` can be installed using\n[cargo](https://doc.rust-lang.org/stable/cargo/):\n\n``` shell\ncargo install xcolor\n```\n\nBuilding and running `xcolor` requires [xcb](https://xcb.freedesktop.org) and\n[Xlib](https://www.x.org/wiki/) libraries to be present.\n\nTo get the latest development version of `xcolor`, you can direct cargo to\ninstall from the git repository:\n\n``` shell\ncargo install --git 'https://github.com/Soft/xcolor.git'\n```\n\nInstalling `xcolor` with cargo will not install its manual page or desktop file.\nTo also install these additional files, invoke `make install` in the project\ndirectory. By default, the install script will place the files under\n`/usr/local/` hierarchy.\n\n### Arch Linux\n\n`xcolor` is available in the Arch Linux [community repository](https://archlinux.org/packages/community/x86_64/xcolor/). To install it with [pacman](https://wiki.archlinux.org/title/Pacman):\n\n``` shell\npacman -S xcolor\n```\n\n## Usage\n\nSimply invoke the `xcolor` command to select a color. The selected color will be\nprinted to the standard output.\n\n``` text\nxcolor 0.5.0\nSamuel Laurén \u003csamuel.lauren@iki.fi\u003e:Callum Osmotherly \u003cacheronfail@gmail.com\u003e\nLightweight color picker for X11\n\nUSAGE:\n    xcolor [OPTIONS]\n\nFLAGS:\n    -h, --help       Prints help information\n    -V, --version    Prints version information\n\nOPTIONS:\n    -c, --custom \u003cFORMAT\u003e                Custom output format\n    -f, --format \u003cNAME\u003e                  Output format (defaults to hex) [possible values: hex, HEX, hex!, HEX!, plain,\n                                         rgb]\n    -P, --preview-size \u003cPREVIEW_SIZE\u003e    Size of preview, must be odd (defaults to 255)\n    -S, --scale \u003cSCALE\u003e                  Scale of magnification (defaults to 8)\n    -s, --selection \u003cSELECTION\u003e          Output to selection (defaults to clipboard) [possible values: primary,\n                                         secondary, clipboard]\n```\n\n## Saving to Selection\n\nBy default, the selected color is printed to the standard output. By specifying\nthe `-s` flag, `xcolor` can be instructed to instead save the color to X11's\nselection. The selection to use can be specified as an argument. Possible\nselection values are `clipboard` (the default), `primary`, and `secondary`.\n\nBecause of the way selections work in X11, `xcolor` forks into background when\n`-s` mode is used. This behavior can be disabled by defining `XCOLOR_FOREGROUND`\nenvironment variable.\n\n## Color Preview\n\nThe `-S` or `--scale` flag controls the upscaling (or zoom) of the preview. By\ndefault it is set to `8` which indicates an 8x zoom level.\n\nThe `-P` or `--preview-size` flag controls the size of the preview in pixels. So\nthat the preview always has a center pixel this number must be odd, if an even\nnumber is passed then it will be changed to the next odd number.\n\n## Formatting\n\nBy default, the color values will be printed in lowercase hexadecimal format.\nThe output format can be changed using the `-f NAME` switch. Supported format\nnames are listed below:\n\n| Format Specifier | Description                               | Example               | Custom Format Equivalent |\n| ---------------- | ----------------------------------------- | --------------------- | ------------------------ |\n| `hex`            | Lowercase hexadecimal (default)           | `#ff00ff`             | `#%{02hr}%{02hg}%{02hb}` |\n| `HEX`            | Uppercase hexadecimal                     | `#00FF00`             | `#%{02Hr}%{02Hg}%{02Hb}` |\n| `hex!`           | Compact lowercase hexadecimal\u003csup\u003e1\u003c/sup\u003e | `#fff`                | Not expressible          |\n| `HEX!`           | Compact uppercase hexadecimal\u003csup\u003e1\u003c/sup\u003e | `#F0F`                | Not expressible          |\n| `rgb`            | Decimal RGB                               | `rgb(255, 255, 255)`  | `rgb(%{r}, %{g}, %{b})`  |\n| `plain`          | Decimal with semicolon separators         | `0;0;0`               | `%{r};%{g};%{b}`         |\n\n**1**: The compact form refers to CSS three-letter color codes as specified by [CSS\nColor Module Level 3](https://www.w3.org/TR/2018/PR-css-color-3-20180315/#rgb-color).\nIf the color is not expressible in three-letter form, the regular six-letter\nform will be used.\n\n## Custom Formats\n\nThe `-f` switch provides quick access to some commonly used formatting options.\nHowever, if custom output formatting is desired, this can be achieved using the\n`-c FORMAT` switch. The `FORMAT` parameter specifies a template for the output\nand supports a simple template language.\n\n`FORMAT` templates can contain special expansions that are written inside\n`%{...}` blocks. These blocks will be expanded into color values according to\nthe specifiers defined inside the block. Here are some examples of valid format\nstrings and what they might translate to:\n\n| Format String            | Example Output     |\n| ------------------------ | ------------------ |\n| `%{r}, %{g}, %{b}`       | `255, 0, 100`      |\n| `Green: %{-4g}`          | `Green: ---7`      |\n| `#%{02hr}%{02hg}%{02hb}` | `#00ff00`          |\n| `%{016Br}`               | `0000000000000011` |\n\nExpansion blocks in format strings always contain a channel specifier (`r` for\nred, `g` for green, and `b` for blue). Additionally, they can contain an\noptional number format specifier (`h` for lowercase hexadecimal, `H` for\nuppercase hexadecimal, `o` for octal, `B` for binary, and `d` for decimal) and\nan optional padding specifier consisting of a character to use for padding and\nthe length the string should be padded to. We can use these rules to decode the\nabove example string:\n\n``` text\n  %{016Br}\n    | |||\n    | ||`- Channel (red)\n    | |`-- Number format specifier (binary)\n    | `--- Padding length (16)\n    `----- Character to use for padding (0)\n```\n\nIn the output, we get the contents of the red color channel formatted in binary\nand padded with zeroes to be sixteen characters long.\n\n## Issues\n\nBugs \u0026 Issues should be reported at [GitHub](https://github.com/Soft/xcolor/issues).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsoft%2Fxcolor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsoft%2Fxcolor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsoft%2Fxcolor/lists"}