GithubHelp home page GithubHelp logo

color-theme-approximate's Introduction

color-theme-approximate

Better degration for color theme in terminal. Inspired by: Vim's CSApprox http://www.vim.org/scripts/script.php?script_id=2390

Color themes usually defined in 24bit, while terminals normally only support 256 colors (8bit). Emacs' default degration algorithm doesn't work well in some systems, especially Linux. This package provides a better degration results by alter the default degrading algorithm.

Preview with Twilight Anti-Bright Theme by Jim Myhrberg

Twilight Anti-Bright Theme

Note that I only encountered the problem in Linux, on Mac OS X the degration seems to work so you don't need this package.

Installation and Usage

Emacs 24

  • Install the package via MELPA, or add the package's directory to load-path

  • Add to your Emacs init file:

      (color-theme-approximate-on)
    

Note: I test this only on Emacs 24.1 and above. Pull requests for supporting other versions are welcomed.

Credits

Tung Dao [email protected]

License

BSD

color-theme-approximate's People

Contributors

tungd avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

emacsmirror

color-theme-approximate's Issues

Approximations don't work on initial startup

Even with this fairly minimal init.el I simply can't get the approximation to work without having to do some manual work after starting emacs:

(require 'package)
(setq package-archives '(("melpa-unstable" . "http://unstable.melpa.org/packages/")))
(package-initialize)
(unless package-archive-contents (package-refresh-contents))
(unless (package-installed-p 'color-theme-approximate) (package-install 'color-theme-approximate))
(unless (package-installed-p 'sublime-themes) (package-install 'sublime-themes))
(color-theme-approximate-on)
(load-theme 'spolsky t)

Result after emacs -nw and the above init.el: default-approximated theme. Re-enabling the theme e.g. with M-x enable-theme causes the approximation to kick in, but I haven't found a way of getting it to work automatically. I tried using tty-setup-hook to delay calling load-theme but it didn't affect the end result.

emacs --version reports "GNU Emacs 24.4.1".

Am I doing something wrong?

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.