[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/autothemer 0b558a7cab 20/29: Update autothemer.el
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/autothemer 0b558a7cab 20/29: Update autothemer.el |
Date: |
Sun, 28 Aug 2022 22:58:46 -0400 (EDT) |
branch: elpa/autothemer
commit 0b558a7cab8622f621e31969442dab52ecc568df
Author: Jason Milkins <jasonm23@users.noreply.github.com>
Commit: jasonm23 <jasonm23@gmail.com>
Update autothemer.el
---
autothemer.el | 41 +++++++++++++++++++++--------------------
1 file changed, 21 insertions(+), 20 deletions(-)
diff --git a/autothemer.el b/autothemer.el
index 197a31b4f5..c89a9f6603 100644
--- a/autothemer.el
+++ b/autothemer.el
@@ -449,17 +449,15 @@ In `(h s v)' `h', `s' and `v' are `0.0..1.0'."
((zerop sat) 0.0)
((= r bri) (funcall normalize 0.0 g b)) ; dominant r
((= g bri) (funcall normalize 120.0 b r)) ; dominant g
- (t (funcall normalize 240.0 r g)))
+ (t (funcall normalize 240.0 r g))) ; dominant b
360.0)
sat
bri))))
(defun autothemer-hex-to-rgb (hex)
"Fast convert HEX to `(r g b)'.
-
-Fast as in no error checking and a early escape for
-
-`r', `g', `b' will be values `0.9..1.1'"
+(Perf equal to wx color values C function.)
+`r', `g', `b' will be values `0..65535'"
(let ((rgb (string-to-number (substring hex 1) 16)))
(list
(* #x101 (ash (logand #xFF0000 rgb) -16))
@@ -467,15 +465,15 @@ Fast as in no error checking and a early escape for
(* #x101 (logand #xFF rgb)))))
(defun autothemer-color-hue (hex-color)
- "Return the HSL hue of HEX-COLOR."
+ "Return the HSV hue of HEX-COLOR."
(car (autothemer--color-to-hsv (autothemer-hex-to-rgb hex-color))))
(defun autothemer-color-sat (hex-color)
- "Return the HSL sat of HEX-COLOR."
+ "Return the HSV sat of HEX-COLOR."
(cadr (autothemer--color-to-hsv (autothemer-hex-to-rgb hex-color))))
(defun autothemer-color-brightness (hex-color)
- "Return the HSL luminance of HEX-COLOR."
+ "Return the HSV brightness of HEX-COLOR."
(caddr (autothemer--color-to-hsv (autothemer-hex-to-rgb hex-color))))
(defun autothemer-darkest-order (a b)
@@ -504,11 +502,13 @@ Fast as in no error checking and a early escape for
(defun autothemer-hue-sat-order (a b)
"Return t if the hue and sat of a > b."
- (let ((a (autothemer-color-hue (autothemer--color-value a)))
- (b (autothemer-color-hue (autothemer--color-value b))))
- (> a b)))
-
-(autothemer--color-to-hsv (autothemer-hex-to-rgb "#FF007F"))
+ (let ((a-hue (autothemer-color-hue (autothemer--color-value a)))
+ (b-hue (autothemer-color-hue (autothemer--color-value b)))
+ (a-sat (autothemer-color-sat (autothemer--color-value a)))
+ (b-sat (autothemer-color-sat (autothemer--color-value b)))
+ (sort-hash-fmt "%016s-%016s"))
+ (string> (format sort-hash-fmt a-hue a-sat)
+ (format sort-hash-fmt b-hue b-sat)))
(defun autothemer-sort-palette (theme-colors &optional fn)
"Produce a list of sorted THEME-COLORS using FN.
@@ -526,7 +526,8 @@ There are also `autothemer-hue-order' and
`autothemer-saturated-order'"
(defun autothemer-generate-palette-svg (&optional options)
"Create an SVG palette image for a theme.
-Optionally supply OPTIONS, a plist (all keys are optional):
+Optionally supply a plist of OPTIONS (all keys are optional,
+required values will default or prompt interactively.):
:theme-file - theme filename
:theme-name - override the title found in :theme-file
@@ -537,12 +538,12 @@ Optionally supply OPTIONS, a plist (all keys are
optional):
:swatch-rotate - degrees of rotation for swatch (default: 45)
:columns - number of columns for each palette row (default: 6)
:page-template - see page-template below
- :page-top-margin - (default ...)
- :page-right-margin - (default ...)
- :page-bottom-margin - (default ...)
- :page-left-margin - (default ...)
- :h-space - (default ...)
- :v-space - (default ...)
+ :page-top-margin - (default 120)
+ :page-right-margin - (default 30)
+ :page-bottom-margin - (default 60)
+ :page-left-margin - (default 30)
+ :h-space - (default 10)
+ :v-space - (default 10)
:swatch-template - see swatch-template below
:font-family - font name to use in the generated SVG
:bg-color
- [nongnu] elpa/autothemer a528436677 16/29: 0.2.10, (continued)
- [nongnu] elpa/autothemer a528436677 16/29: 0.2.10, ELPA Syncer, 2022/08/28
- [nongnu] elpa/autothemer b0df7578fc 17/29: Additional parameters for svg generator., ELPA Syncer, 2022/08/28
- [nongnu] elpa/autothemer 5d7ae3a0be 06/29: Rainbow mode: Colorize names from palette, ELPA Syncer, 2022/08/28
- [nongnu] elpa/autothemer 55db54a2ef 08/29: User parameters added for SVG generator, ELPA Syncer, 2022/08/28
- [nongnu] elpa/autothemer 12dbb2e605 15/29: Merge branch 'master' into develop, ELPA Syncer, 2022/08/28
- [nongnu] elpa/autothemer 67224c4a4c 21/29: Fix test run, ELPA Syncer, 2022/08/28
- [nongnu] elpa/autothemer 726d5b99bb 05/29: Only supporting 26.1 and above, ELPA Syncer, 2022/08/28
- [nongnu] elpa/autothemer 2b55532e0a 10/29: Fix test runner, ELPA Syncer, 2022/08/28
- [nongnu] elpa/autothemer f4ab56f44f 13/29: Structural change v-stacking, ELPA Syncer, 2022/08/28
- [nongnu] elpa/autothemer 9bde5000f4 19/29: CONTRIBUTING.md, ELPA Syncer, 2022/08/28
- [nongnu] elpa/autothemer 0b558a7cab 20/29: Update autothemer.el,
ELPA Syncer <=
- [nongnu] elpa/autothemer 882fd8f7bb 22/29: Update README, bin/test & SVG swatch sort hue-sat, ELPA Syncer, 2022/08/28
- [nongnu] elpa/autothemer 77ad2ec093 23/29: Trigger actions for pushes to master, or PRs, ELPA Syncer, 2022/08/28
- [nongnu] elpa/autothemer 1bc52d721d 27/29: Add issue templates, ELPA Syncer, 2022/08/28
- [nongnu] elpa/autothemer 97f7276eb1 28/29: Merge Pull request #23 from develop, ELPA Syncer, 2022/08/28
- [nongnu] elpa/autothemer f3a23b4b6d 29/29: Image moved to images branch, ELPA Syncer, 2022/08/28
- [nongnu] elpa/autothemer c6167daa05 09/29: Name test workflow, ELPA Syncer, 2022/08/28
- [nongnu] elpa/autothemer 9fe64dd3cd 14/29: Page placement looks better, needs polishing, ELPA Syncer, 2022/08/28
- [nongnu] elpa/autothemer cd7c3e7dd4 24/29: Add CONTRIBUTING to README, ELPA Syncer, 2022/08/28
- [nongnu] elpa/autothemer 180143b7fe 25/29: Add NEWS to README, ELPA Syncer, 2022/08/28
- [nongnu] elpa/autothemer b06eb4ef6b 26/29: Update using Autothemer list (README), ELPA Syncer, 2022/08/28