GithubHelp home page GithubHelp logo

tmcolorconv's Introduction

tmTheme Color Convert

Many TextMate 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).

I wrote this while working on a blog post about the effects of color management on themes in text editors.

Usage

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 file

optional 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 on Windows.

Original and sRGB version of Monokai:

Monokai

Original and sRGB version of Railscasts:

Railscasts

Original and sRGB version of Tomorrow Night:

Tomorrow Night

Original and sRGB version of Twilight:

Twilight

License

This projected is licensed under the terms of the MIT license.

tmcolorconv's People

Contributors

jibsen avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.