Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong colors in the theme #141

Open
mavidser opened this issue Jan 27, 2015 · 7 comments
Open

Wrong colors in the theme #141

mavidser opened this issue Jan 27, 2015 · 7 comments

Comments

@mavidser
Copy link

This is my init.d:

(add-to-list 'custom-theme-load-path "~/.emacs.d/emacs-color-theme-solarized")
(load-theme 'solarized-dark t)

http://i.imgur.com/TvfxmaC.png

What am I doing wrong?
I'm using xterm-256color.

@sellout
Copy link
Owner

sellout commented Jan 27, 2015

Well, that is terrifying 😉

First, I’m assuming that you have a pretty up-to-date version of Solarized, which means that there is no longer separate solarized-dark and solarized-light themes (although those names still exist to avoid breaking everyone’s init files). There is now just solarized and you can set background-mode per-frame to get either the light or dark variant (see the README for some more details on how to do that).

If you do have a fairly current version, you probably have to do one of two things. Either

  1. set solarized-termcolors to 256, which should give you not-perfect-but-close colors on any 256-color term or
  2. configure your terminal with the appropriate 16-color palette (xresources and some other terminal settings are available), which should get you the exact colors on most terminals.

Really, I should probably switch the default solarized-termcolors to 256, because that should just work, and let people who bother to configure more things set it to 16 to get the perfect colors.

Let me know if that was helpful.

@mikefaille
Copy link

With :

(set-background-color "black")

(unless window-system
  (setq solarized-termcolors '256)
  )

(unless window-system
  (setq solarized-degrade nil)
  )

it give me (makepkg.sh in emacs-color-theme-solarized root):
capture d ecran de 2015-01-28 06 56 54

And, I don't see comments in lisp mode.

But, with this settings (16 colors)

(set-background-color "black")
(add-hook 'after-make-frame-functions
          (setq solarized-termcolors (if window-system '256 '16))
          (lambda (frame)
            (set-frame-parameter frame
                                 'background-mode
                                 'dark)
            (enable-theme 'solarized))

          )
(load-theme 'solarized)

I have something better :
capture d ecran de 2015-01-28 07 03 19

As my gnome-terminal theme, I use Fedora 21 default/untouched (not solarized one)

@mavidser
Copy link
Author

That's exactly what's happening with me.

@sellout
Copy link
Owner

sellout commented Jan 28, 2015

You shouldn’t conditionalize solarized-termcolors, since it’s global and creating a new GUI frame will reset it to 256 for all your frames (it is only used in terminal frames, so you don’t have to worry about its setting in the GUI). Also, solarized-termcolors takes an integer, not a symbol, so I have a feeling that you’re always getting the 256 behavior, because (/= 16 '16). And there’s no reason to set the background color. Can you run M-x describe-face menu and show me the output? That’ll make it clear what colors are actually being used.

Here’s how I would do what you want:

(setq solarized-termcolors 256)
(add-hook 'after-make-frame-functions
          (lambda (frame)
            (set-frame-parameter frame 'background-mode 'dark))
            (enable-theme 'solarized)))
(load-theme 'solarized)

Instead of the after-make-frame-functions hook, you could just do (add-to-list 'default-frame-alist '(background-mode . dark)), since your hook isn’t doing anything dynamically.

@mikefaille
Copy link

@sellout Without changing something in my config, I have different result today :-/
You can see these results in this small video (unpublished). It's the best way to present my result I think.
Here, I tried :

After, I tried next basic function combination with; like shuffling func order, tried some background assignment, etc. (yes, I'm not an emacs master but I tried logic stuff as I know)

(load-theme 'solarized)
(set-background-color "black")
(add-to-list 'default-frame-alist '(background-mode . dark)
(enable-theme 'solarized)

You can see theses test here : http://youtu.be/51bkotVNdG8
My result : ``lisp (add-to-list 'default-frame-alist '(background-mode . dark)` don't work.

Strangely, this is the most basic configuration I can use to run emacs gui :

(load-theme 'solarized)
(set-background-color "black")
(enable-theme 'solarized)

Note : English isn't my first language.
Note2 : I use auto-async-byte-compile module
Note3 : Wombat native emacs theme work anywhere ie : tty, X terminal, GUI without any special configuration for each env.

@mikefaille
Copy link

For your last request,

Can you run M-x describe-face menu and show me the output? That’ll make it clear what colors are actually being used.

when I see this :
https://camo.githubusercontent.com/2122d1256bf7146ace01263e97a54aaf1f21a3a1/687474703a2f2f692e696d6775722e636f6d2f547666786d61432e706e67

Face: menu (sample) (customize this face)

Documentation:
Basic face for the font and colors of the menu bar and popup menus.

Defined in `faces.el'.

           Family: unspecified
          Foundry: unspecified
            Width: unspecified
           Height: unspecified
           Weight: unspecified
            Slant: unspecified
       Foreground: brightyellow
DistantForeground: unspecified
       Background: white
        Underline: unspecified
         Overline: unspecified
   Strike-through: unspecified
              Box: unspecified
          Inverse: unspecified
          Stipple: unspecified
             Font: unspecified
          Fontset: unspecified
          Inherit: unspecified

My emacs version : GNU Emacs 24.4.1 (x86_64-redhat-linux-gnu, GTK+ Version 3.14.5) of 2014-11-19 on buildvm-03.phx2.fedoraproject.org
Face-at-point : nil

@mikefaille
Copy link

@sellout I just done few test this morning and I don't have theses set of problems with light-theme

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants