Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jibsen/tmcolorconv
Convert tmTheme to sRGB color space
https://github.com/jibsen/tmcolorconv
conversion python3 srgb textmate theme
Last synced: 11 days ago
JSON representation
Convert tmTheme to sRGB color space
- Host: GitHub
- URL: https://github.com/jibsen/tmcolorconv
- Owner: jibsen
- License: mit
- Created: 2014-08-29T13:34:40.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2018-12-11T07:27:09.000Z (almost 6 years ago)
- Last Synced: 2023-10-20T20:45:55.103Z (about 1 year ago)
- Topics: conversion, python3, srgb, textmate, theme
- Language: Python
- Size: 249 KB
- Stars: 9
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
tmTheme Color Convert
=====================Many [TextMate](http://macromates.com/) color themes were designed on Mac
OS X, which used the Generic RGB color profile and a gamma of 1.8 by default.
This results in the colors being darker if used directly on Windows.For portability and compatibility with other editors and operating systems,
it is better to use sRGB.This script will convert the color values in a tmTheme file from Generic RGB
to sRGB, optionally applying simple alpha blending with the foreground and
background colors (for TextMate 2 themes before [this change][blend]).I wrote this while working on a [blog post][post] about the effects of color
management on themes in text editors.[post]: http://hardtoc.com/2014/09/03/not-quite-monokai.html
[blend]: https://github.com/textmate/textmate/commit/8e1aa09Usage
-----The scripts are written for Python 3.
`tmcolorconv.py` takes a tmTheme file and converts the color values from
Generic RGB to sRGB. A gamma value to be used for the original file can be
supplied, and optionally colors with alpha values can be blended with
foreground/background color instead of copied.usage: tmcolorconv.py [-h] [-g GAMMA] [-b] infile outfile
Convert Generic RGB to sRGB.
positional arguments:
infile input tmTheme file
outfile output tmTheme fileoptional arguments:
-h, --help show this help message and exit
-g GAMMA, --gamma GAMMA
input gamma (default 1.8)
-b blend alpha`mkconvmatrix.py` is a playground for working with color space conversions. It
was used to compute the `GenericRGBtosRGB` matrix used in `tmcolorconv.py`.Examples
--------These screenshots show the themes from the examples folder in
[Sublime Text 3][Sublime] on Windows.Original and sRGB version of [Monokai][]:
![Monokai](examples/monokai_compare.png)
Original and sRGB version of [Railscasts][]:
![Railscasts](examples/railscasts_compare.png)
Original and sRGB version of [Tomorrow Night][Tomorrow]:
![Tomorrow Night](examples/tomorrow_compare.png)
Original and sRGB version of [Twilight][]:
![Twilight](examples/twilight_compare.png)
[Sublime]: http://www.sublimetext.com/
[Monokai]: http://www.monokai.nl/blog/2006/07/15/textmate-color-theme/
[Railscasts]: http://railscasts.com/about
[Tomorrow]: https://github.com/chriskempson/tomorrow-theme
[Twilight]: https://github.com/textmate/themes.tmbundleLicense
-------This projected is licensed under the terms of the [MIT license](LICENSE).