display-colors


Namedisplay-colors JSON
Version 0.4.1 PyPI version JSON
download
home_pagehttps://github.com/JoeRodrigue/display-colors
SummaryShows the 4-bit color and display effect capabilities of a terminal emulator
upload_time2024-04-22 00:40:18
maintainerJoe Rodrigue
docs_urlNone
authorJoe Rodrigue
requires_python<4.0,>=3.7
licenseNone
keywords color terminal emulator sgr ecma-48
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # display-colors

`display-colors` is a program to explore the color and display effect capabilities of a terminal emulator

## Compatibility

At present `display-colors` only runs on macOS.
It requires Python 3.

## Installation and Use

`display-colors` should be installed in a virtual environment.

### How to Create, Use and Destroy a Virtual Environment

```
python -m venv .venv         // Create the virtual environment '.venv'
source .venv/bin/activate    // Enter .venv
(.venv) ...                  // While in the virtual environment, your prompt will be prefixed with '(.venv)'
(.venv) deactivate           // Exit .venv
rm -rf .venv                 // Destroy .venv
```

### How to Install and Uninstall `display-colors`

```
(.venv) python -m pip   install display-colors  // Install
(.venv) python -m pip uninstall display-colors  // Uninstall
```

### Use

```
(.venv) display-colors [OPTIONS]
```

## Features

`display-colors` produces test patterns that show the capabilities of your terminal emulator.  They include each combination of foreground and background four-bit colors, which can vary depending on the theme (some themes barely support the bright variants of the eight basic colors, which are not included in the original ECMA-48 standard).  The program also demonstrates each Select Graphic Rendition (SGR) code controlling effects like underline and blink.  Support for these among emulators is spotty.

It has three modes:

 - Standard -- A color palette in the traditional format (*qv* [iTerm2 Color Schemes](https://iterm2colorschemes.com/))
 - Transpose -- A palette with one foreground color per column
 - Test -- A test pattern of terminal effects

### Standard mode (default)

Options:

 - `--col-width` *`n`* -- Width of the columns in the body of the output table (default: 7)
 - `--gutter` *`string`* -- Delimiter between output columns (default: empty string)
 - `--reverse-video` -- Repeats each row using BG-color on FG-color in reverse video.  Some terminal emulators don't implement reverse video as BG-color on FG-color.  If yours does, this transformation is a no-op and this row should appear identical to the row above it
 - `--stanzas` -- Group output rows by color (default: off)
 - `--text` *`string`* -- Specifies the sample text to be displayed in each cell (default: `gYw`)
 - `-w` *`string`*, `--weight` *`string`* -- Specifies which weight font to display and in what order (use multiple times).  Supported weights are `dim`, `default`, `medium`, `bold` and `all` (default: `default`, `bold`)

This format lists background colors one per column with their SGR codes at top and left.  The default background color is the leftmost column and the topmost rows show the default foreground color.

Each row is labeled on the left with its weight.  If the row is reverse video, the weight label will appear in reverse video.

### Transpose mode (`--transpose`)

Options:

 - `--col-width` *`n`* -- (see 'Standard mode' above)
 - `--gutter` *`string`* -- (see 'Standard mode' above)
 - `--reverse-video` -- (see 'Standard mode' above)
 - `-w` *`string`*, `--weight` *`string`* -- (see 'Standard mode' above)

This format lists foreground colors one per column, with the default foreground color in the leftmost column and the default background color in the topmost rows.  The SGR codes are not shown and the sample text is of the form fg/bg.

### Test mode (`--test`)

Options:

 - `--pattern` *`string`* -- Specify a string to use as a sample text pattern (default: '|').  Most screens will not be wide enough to accomodate a test pattern string of more than one character.  (If the pattern string contains a character that has a special meaning to the shell, like '|', it must be escaped (preceded) by a backslash: `--pattern \|`).
 - `--gutter` *`string`* -- (see 'Standard mode' above)

Displays a sample of the effect of each SGR code in all 4-bit foreground and background colors (see [Wikipedia](https://en.wikipedia.org/wiki/ANSI_escape_code#SGR_(Select_Graphic_Rendition)_parameters) for the list of SGR codes).  Some effects may be more visible in certain colors than in others.  The text samples are displayed in groups of three:

 1.  Without applying the effect
 2.  After turning the effect on
 3.  After turning the effect off again

So for a supported effect, you should see that effect applied to the second character only and the first and third characters should be identical.

Practically all of the effects can be individually turned on and off.  One code was unwisely assigned to both 'bold off' and 'double underline on', and for emulators that support double underline you can see this in the 'Bold:' row.  For those emulators you should substitute a different SGR code, such as the one for 'medium', in place of 'bold off'.

### Color names

The display uses abbreviations for the colors, as follows:

 | | |
 | :---: | :--- |
 | df | Default color |
 | bk | Black |
 | re | Red |
 | gr | Green |
 | ye | Yellow |
 | bl | Blue |
 | ma | Magenta |
 | cy | Cyan |
 | wh | White |
 | BK | Bright black |
 | RE | Bright red |
 | GR | Bright green |
 | YE | Bright yellow |
 | BL | Bright blue |
 | MA | Bright magenta |
 | CY | Bright cyan |
 | WH | Bright white |

## Examples

Traditional palette, including all font weights, with reverse-video rows, divided into stanzas by color:

```bash
display-colors --weight all --reverse-video --stanzas
```

Palette with one column per foreground color, rows ordered 'dim, medium, bold, medium' and spaces between the columns:

```bash
display-colors --transpose -w dim -w medium -w bold -w medium --gutter ' '
```

Terminal effect test pattern with spaces between the columns:

```bash
display-colors --test --gutter ' '
```

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/JoeRodrigue/display-colors",
    "name": "display-colors",
    "maintainer": "Joe Rodrigue",
    "docs_url": null,
    "requires_python": "<4.0,>=3.7",
    "maintainer_email": "joe.rodrigue@gmail.com",
    "keywords": "color, terminal, emulator, SGR, ECMA-48",
    "author": "Joe Rodrigue",
    "author_email": "joe.rodrigue@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/38/d3/3c383fe643c01fd467f4e49c5a0f0d209b9208a291fa30db579263869b28/display_colors-0.4.1.tar.gz",
    "platform": null,
    "description": "# display-colors\n\n`display-colors` is a program to explore the color and display effect capabilities of a terminal emulator\n\n## Compatibility\n\nAt present `display-colors` only runs on macOS.\nIt requires Python 3.\n\n## Installation and Use\n\n`display-colors` should be installed in a virtual environment.\n\n### How to Create, Use and Destroy a Virtual Environment\n\n```\npython -m venv .venv         // Create the virtual environment '.venv'\nsource .venv/bin/activate    // Enter .venv\n(.venv) ...                  // While in the virtual environment, your prompt will be prefixed with '(.venv)'\n(.venv) deactivate           // Exit .venv\nrm -rf .venv                 // Destroy .venv\n```\n\n### How to Install and Uninstall `display-colors`\n\n```\n(.venv) python -m pip   install display-colors  // Install\n(.venv) python -m pip uninstall display-colors  // Uninstall\n```\n\n### Use\n\n```\n(.venv) display-colors [OPTIONS]\n```\n\n## Features\n\n`display-colors` produces test patterns that show the capabilities of your terminal emulator.  They include each combination of foreground and background four-bit colors, which can vary depending on the theme (some themes barely support the bright variants of the eight basic colors, which are not included in the original ECMA-48 standard).  The program also demonstrates each Select Graphic Rendition (SGR) code controlling effects like underline and blink.  Support for these among emulators is spotty.\n\nIt has three modes:\n\n - Standard -- A color palette in the traditional format (*qv* [iTerm2 Color Schemes](https://iterm2colorschemes.com/))\n - Transpose -- A palette with one foreground color per column\n - Test -- A test pattern of terminal effects\n\n### Standard mode (default)\n\nOptions:\n\n - `--col-width` *`n`* -- Width of the columns in the body of the output table (default: 7)\n - `--gutter` *`string`* -- Delimiter between output columns (default: empty string)\n - `--reverse-video` -- Repeats each row using BG-color on FG-color in reverse video.  Some terminal emulators don't implement reverse video as BG-color on FG-color.  If yours does, this transformation is a no-op and this row should appear identical to the row above it\n - `--stanzas` -- Group output rows by color (default: off)\n - `--text` *`string`* -- Specifies the sample text to be displayed in each cell (default: `gYw`)\n - `-w` *`string`*, `--weight` *`string`* -- Specifies which weight font to display and in what order (use multiple times).  Supported weights are `dim`, `default`, `medium`, `bold` and `all` (default: `default`, `bold`)\n\nThis format lists background colors one per column with their SGR codes at top and left.  The default background color is the leftmost column and the topmost rows show the default foreground color.\n\nEach row is labeled on the left with its weight.  If the row is reverse video, the weight label will appear in reverse video.\n\n### Transpose mode (`--transpose`)\n\nOptions:\n\n - `--col-width` *`n`* -- (see 'Standard mode' above)\n - `--gutter` *`string`* -- (see 'Standard mode' above)\n - `--reverse-video` -- (see 'Standard mode' above)\n - `-w` *`string`*, `--weight` *`string`* -- (see 'Standard mode' above)\n\nThis format lists foreground colors one per column, with the default foreground color in the leftmost column and the default background color in the topmost rows.  The SGR codes are not shown and the sample text is of the form fg/bg.\n\n### Test mode (`--test`)\n\nOptions:\n\n - `--pattern` *`string`* -- Specify a string to use as a sample text pattern (default: '|').  Most screens will not be wide enough to accomodate a test pattern string of more than one character.  (If the pattern string contains a character that has a special meaning to the shell, like '|', it must be escaped (preceded) by a backslash: `--pattern \\|`).\n - `--gutter` *`string`* -- (see 'Standard mode' above)\n\nDisplays a sample of the effect of each SGR code in all 4-bit foreground and background colors (see [Wikipedia](https://en.wikipedia.org/wiki/ANSI_escape_code#SGR_(Select_Graphic_Rendition)_parameters) for the list of SGR codes).  Some effects may be more visible in certain colors than in others.  The text samples are displayed in groups of three:\n\n 1.  Without applying the effect\n 2.  After turning the effect on\n 3.  After turning the effect off again\n\nSo for a supported effect, you should see that effect applied to the second character only and the first and third characters should be identical.\n\nPractically all of the effects can be individually turned on and off.  One code was unwisely assigned to both 'bold off' and 'double underline on', and for emulators that support double underline you can see this in the 'Bold:' row.  For those emulators you should substitute a different SGR code, such as the one for 'medium', in place of 'bold off'.\n\n### Color names\n\nThe display uses abbreviations for the colors, as follows:\n\n | | |\n | :---: | :--- |\n | df | Default color |\n | bk | Black |\n | re | Red |\n | gr | Green |\n | ye | Yellow |\n | bl | Blue |\n | ma | Magenta |\n | cy | Cyan |\n | wh | White |\n | BK | Bright black |\n | RE | Bright red |\n | GR | Bright green |\n | YE | Bright yellow |\n | BL | Bright blue |\n | MA | Bright magenta |\n | CY | Bright cyan |\n | WH | Bright white |\n\n## Examples\n\nTraditional palette, including all font weights, with reverse-video rows, divided into stanzas by color:\n\n```bash\ndisplay-colors --weight all --reverse-video --stanzas\n```\n\nPalette with one column per foreground color, rows ordered 'dim, medium, bold, medium' and spaces between the columns:\n\n```bash\ndisplay-colors --transpose -w dim -w medium -w bold -w medium --gutter ' '\n```\n\nTerminal effect test pattern with spaces between the columns:\n\n```bash\ndisplay-colors --test --gutter ' '\n```\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "Shows the 4-bit color and display effect capabilities of a terminal emulator",
    "version": "0.4.1",
    "project_urls": {
        "Homepage": "https://github.com/JoeRodrigue/display-colors",
        "Repository": "https://github.com/JoeRodrigue/display-colors"
    },
    "split_keywords": [
        "color",
        " terminal",
        " emulator",
        " sgr",
        " ecma-48"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "f6a9a4cc076db8ee3f42c750dbadc061d88554702e083988d130ac19de7748ff",
                "md5": "2ea25c119b34ab6746348b9a6bc5e3f5",
                "sha256": "5ea81d9983dff55790bf8136f77c0e046b0c87a67b8fce9bdcf83c3b168790ac"
            },
            "downloads": -1,
            "filename": "display_colors-0.4.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "2ea25c119b34ab6746348b9a6bc5e3f5",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.7",
            "size": 11173,
            "upload_time": "2024-04-22T00:40:17",
            "upload_time_iso_8601": "2024-04-22T00:40:17.061080Z",
            "url": "https://files.pythonhosted.org/packages/f6/a9/a4cc076db8ee3f42c750dbadc061d88554702e083988d130ac19de7748ff/display_colors-0.4.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "38d33c383fe643c01fd467f4e49c5a0f0d209b9208a291fa30db579263869b28",
                "md5": "6a5ad5e075e47cb1add408963ced2c2f",
                "sha256": "377ebdefc255018de8d348625019e7d07d8941075f78d3cb44a7fcd14eb73233"
            },
            "downloads": -1,
            "filename": "display_colors-0.4.1.tar.gz",
            "has_sig": false,
            "md5_digest": "6a5ad5e075e47cb1add408963ced2c2f",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.7",
            "size": 10236,
            "upload_time": "2024-04-22T00:40:18",
            "upload_time_iso_8601": "2024-04-22T00:40:18.925703Z",
            "url": "https://files.pythonhosted.org/packages/38/d3/3c383fe643c01fd467f4e49c5a0f0d209b9208a291fa30db579263869b28/display_colors-0.4.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-04-22 00:40:18",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "JoeRodrigue",
    "github_project": "display-colors",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "display-colors"
}
        
Elapsed time: 0.24320s