Code Monkey home page Code Monkey logo

autothemer's Introduction

Metrics

autothemer's People

Contributors

dieggsy avatar edwintorok avatar jasonm23 avatar patrick-poitras avatar sebastiansturm avatar skangas avatar syohex avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

autothemer's Issues

Use a better measure of 'color distance'?

autothemer currently uses RGB differences as a measure of color similarity, but there are probably perceptual color measures out there that yield better / more intuitive results

Broken on Emacs 27

I recently took my config from emacs 26.3 to emacs 27. In the process I noticed that calling eval-defun on the autothemer-deftheme block no longer changes any of the faces. I am not sure what has changed or how to address it.

autothemer-generate-templates returns wrong-type-argument symbolp (1 . -1)

Hi @jasonm23, I'm tried your package but something goes wrong. Below, I provide a sample code to reproduce the error step by step. Can you help with this?

I write the sample code in the file minimal.el. Then, I loaded the file in emacs using emacs -q -l ~/minimal.el. I have changed the colors yellowish and reddish from the example code in your README.

;; minimal.el
;; run with `emacs -q -l /path/to/minimal.el'

(require 'package)
(setq package-archives '(("melpa" . "https://melpa.org/packages/")
                         ("elpa" . "https://elpa.gnu.org/packages/")))

(package-initialize)
(unless package-archive-contents
  (package-refresh-contents))

;; Initialize use-package on non-Linux platforms
(unless (package-installed-p 'use-package)
  (package-install 'use-package))

;; activate use-package
(require 'use-package)

(use-package autothemer)

(autothemer-deftheme example-name "Autothemer example..."

                     ;; Specify the color classes used by the theme
                     ((((class color) (min-colors #xFFFFFF))
                       ((class color) (min-colors #xFF)))

                      ;; Specify the color palette for each of the classes above.
                      (example-red    "#781210" "#FF0000")
                      (example-green  "#22881F" "#00D700")
                      (example-blue   "#212288" "#0000FF")
                      (example-purple "#812FFF" "#Af00FF")
                      (example-yellow "#EFFE00" "#FFFF00")
                      (example-orange "#E06500" "#FF6600")
                      (example-cyan   "#22DDFF" "#00FFFF"))

                     ;; specifications for Emacs faces.
                     ((button (:underline t :weight 'bold :foreground example-yellow))
                      (error  (:foreground example-red)))

                     ;; Forms after the face specifications are evaluated.
                     ;; (palette vars can be used, read below for details.)
                     (custom-theme-set-variables 'example-name
                                                 `(ansi-color-names-vector [,example-red
                                                                            ,example-green
                                                                            ,example-blue
                                                                            ,example-purple
                                                                            ,example-yellow
                                                                            ,example-orange
                                                                            ,example-cyan])))

I turned on toggle-debug-on-error, evaluated the (autothemer-deftheme ..., then I run M-x autothemer-generate-templates, and I received the following message:

Debugger entered--Lisp error: (wrong-type-argument symbolp (1 . -1))
  boundp((1 . -1))
  #f(compiled-function (it) #<bytecode -0x443ba3bfbd9c438>)((1 . -1))
  -tree-map(#f(compiled-function (it) #<bytecode -0x443ba3bfbd9c438>) (1 . -1))
  #f(compiled-function (x) #<bytecode 0x84d6d9bc17bf44a>)((1 . -1))
  mapcar(#f(compiled-function (x) #<bytecode 0x84d6d9bc17bf44a>) (:line-width (1 . -1) :color "grey35"))
  -tree-map(#f(compiled-function (it) #<bytecode -0x443ba3bfbd9c438>) (:line-width (1 . -1) :color "grey35"))
  #f(compiled-function (x) #<bytecode 0x84d6d9bc17bf44a>)((:line-width (1 . -1) :color "grey35"))
  mapcar(#f(compiled-function (x) #<bytecode 0x84d6d9bc17bf44a>) (:box (:line-width (1 . -1) :color "grey35") :foreground "LightBlue" :background "grey19"))
  -tree-map(#f(compiled-function (it) #<bytecode -0x443ba3bfbd9c438>) (:box (:line-width (1 . -1) :color "grey35") :foreground "LightBlue" :background "grey19"))
  #f(compiled-function (x) #<bytecode 0x84d6d9bc17bf44a>)((:box (:line-width (1 . -1) :color "grey35") :foreground "LightBlue" :background "grey19"))
  mapcar(#f(compiled-function (x) #<bytecode 0x84d6d9bc17bf44a>) ((:box (:line-width (1 . -1) :color "grey35") :foreground "LightBlue" :background "grey19")))
  -tree-map(#f(compiled-function (it) #<bytecode -0x443ba3bfbd9c438>) ((:box (:line-width (1 . -1) :color "grey35") :foreground "LightBlue" :background "grey19")))
  autothemer--approximate-spec((help-key-binding (:box (:line-width (1 . -1) :color "grey35") :foreground "LightBlue" :background "grey19")) #s(autothemer--theme :colors (#s(autothemer--color :name example-red :value "#781210") #s(autothemer--color :name example-green :value "#22881F") #s(autothemer--color :name example-blue :value "#212288") #s(autothemer--color :name example-purple :value "#812FFF") #s(autothemer--color :name example-yellow :value "#EFFE00") #s(autothemer--color :name example-orange :value "#E06500") #s(autothemer--color :name example-cyan :value "#22DDFF")) :defined-faces (button error)))
  #f(compiled-function (it) #<bytecode 0xa45ecd4abb6b7>)(help-key-binding)
  mapcar(#f(compiled-function (it) #<bytecode 0xa45ecd4abb6b7>) (diff-refine-added diff-refine-removed diff-refine-changed diff-error diff-nonexistent diff-context diff-function diff-indicator-changed diff-indicator-added diff-indicator-removed diff-changed diff-added diff-removed diff-hunk-header diff-index diff-file-header diff-header Info-quoted info-index-match info-header-node info-header-xref info-xref-visited info-xref info-menu-star info-menu-header info-title-4 info-title-3 info-title-2 info-title-1 info-node package-status-avail-obso package-status-incompat package-status-unsigned package-status-dependency package-status-installed package-status-disabled package-status-held package-status-new package-status-available package-status-external package-status-built-in package-description package-name package-help-section-name browse-url-button tooltip eldoc-highlight-function-argument vc-edited-state vc-missing-state vc-removed-state ...))
  autothemer-generate-templates()
  funcall-interactively(autothemer-generate-templates)
  call-interactively(autothemer-generate-templates record nil)
  command-execute(autothemer-generate-templates record)
  execute-extended-command(nil "autothemer-generate-templates" nil)
  funcall-interactively(execute-extended-command nil "autothemer-generate-templates" nil)
  call-interactively(execute-extended-command nil nil)
  command-execute(execute-extended-command)

I'm on Arch Linux using the Emacs 28.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.29, cairo version 1.17.4) of 2021-06-06.

Thanks in advance for any help.

Force autothemer to use nil

Is there a way to do so? Suppose I have background color like #1e2528 in GUI or anything else, which 256 terminal doesn't support by default, so I want to use terminal background instead. Obviously I can achieve that through faces with condition, but it's a bit annoying in my opinion.

conditionals?

I was hoping to use a conditional in the theme but it doesn't seem to load properly. Is this expected? Here's an example of what I mean:

(when set-bespoke-header-line
  (header-line (:foreground bespoke-light
                :background bespoke-header
                :box (:line-width 6 :color bespoke-header :height 150)
                :overline nil
                :underline nil
                :height 150))

  (mode-line   (:height 10
                :underline bespoke-subtle
                :overline nil
                :box nil)))

Add to MELPA

@sebastiansturm - I'm finally going to start experimenting with Autothemer and I've suggested it's use to @mekeor as the preferred route for developing Gruvbox.

If you haven't added anything to MELPA before let me know and I'll assist.

Ensure semantic versioning is used.

We've had a few updates but the version numbers have remained at 0.2.

When patches are made, the patch version should be bumped.

0.2.1, 0.2.3, 0.2.10, 0.2.11 etc.

To push a release to MELPA stable, it's necessary to use tags. These should match the canonical package version number.

For more info on semantic versioning see http://semver.org/

wrong type argument : arrayp, nil

I have autothemer.el on my load-path, but when I run M-x autothemer-generate-templates I get wrong type argument : arrayp, nil. I'm new to emacs, so apologies if I'm confusing some concepts here.

Improve docmentation

A few things that I think need including in the readme.

  • variables such as those used by style / weight / inherit must be quoted.
  • autothemer deftheme description argument is missing from the readme
  • provide a more complete example as reference. (Darktooth will shortly be using autothemer as a self install package, until MELPA release of autothemer.)

Color palette faces as variables?

Maybe this is out of scope for autothemer, but it'd be nice if the color palette faces were also accessible as variables so they could be used outside of the theme file. It'd be nice to be able to e.g. propertize text using my theme's color palette without having to copy paste the colors every time or define my own faces.

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.