[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 6b2e95a 24/31: Add gamma-correction to alpha-blending
From: |
Oleh Krehel |
Subject: |
[elpa] master 6b2e95a 24/31: Add gamma-correction to alpha-blending |
Date: |
Fri, 01 May 2015 14:29:01 +0000 |
branch: master
commit 6b2e95a35377681e32199baa55e79fb55d2adca1
Author: Oleh Krehel <address@hidden>
Commit: Oleh Krehel <address@hidden>
Add gamma-correction to alpha-blending
* colir.el (colir-compose-method): Make 'colir-compose-alpha default.
(colir-compose-alpha): Add gamma-correction.
---
colir.el | 7 ++++---
1 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/colir.el b/colir.el
index c9a0ada..f5ce0ae 100644
--- a/colir.el
+++ b/colir.el
@@ -32,7 +32,7 @@
(require 'color)
-(defcustom colir-compose-method 'colir-compose-overlay
+(defcustom colir-compose-method 'colir-compose-alpha
"Select a method to compose two color channels."
:type '(choice
(const colir-compose-alpha)
@@ -52,10 +52,11 @@
(* 2 a b)
(- 1 (* 2 (- 1 a) (- 1 b)))))
-(defun colir-compose-alpha (a b &optional alpha)
+(defun colir-compose-alpha (a b &optional alpha gamma)
"Compose A and B channels."
(setq alpha (or alpha 0.5))
- (+ (* a alpha) (* b (- 1 alpha))))
+ (setq gamma (or gamma 2.2))
+ (+ (* (expt a gamma) alpha) (* (expt b gamma) (- 1 alpha))))
(defun colir-blend (c1 c2)
"Blend the two colors C1 and C2 using `colir-compose-method'.
- [elpa] master 278870e 13/31: Use alpha compositing to add ivy-current-match face, (continued)
- [elpa] master 278870e 13/31: Use alpha compositing to add ivy-current-match face, Oleh Krehel, 2015/05/01
- [elpa] master 57de44c 14/31: Makefile: Update, Oleh Krehel, 2015/05/01
- [elpa] master 56d7802 15/31: Add an option for multi-tier regex matching, Oleh Krehel, 2015/05/01
- [elpa] master 7299950 16/31: ivy.el: Fixup docstrings, Oleh Krehel, 2015/05/01
- [elpa] master aa9d4a7 17/31: ivy.el (ivy-re-builders-alist): Improve doc, Oleh Krehel, 2015/05/01
- [elpa] master 0f141f5 18/31: counsel.el (counsel-git-grep): Add optional initial-input, Oleh Krehel, 2015/05/01
- [elpa] master 23ffa25 19/31: Bind "TAB" to do partial completion, Oleh Krehel, 2015/05/01
- [elpa] master ae2fd1a 21/31: Improve hidden buffer completion further, Oleh Krehel, 2015/05/01
- [elpa] master 5dc26fb 20/31: Improve the completion of hidden buffers, Oleh Krehel, 2015/05/01
- [elpa] master 1332b19 22/31: ivy.el (ivy--exhibit): Fixup last commit, Oleh Krehel, 2015/05/01
- [elpa] master 6b2e95a 24/31: Add gamma-correction to alpha-blending,
Oleh Krehel <=
- [elpa] master a868705 23/31: colir.el: Add two additional blend algorithms, Oleh Krehel, 2015/05/01
- [elpa] master 7bd6003 25/31: Update and improve faces, Oleh Krehel, 2015/05/01
- [elpa] master 94b6a83 26/31: Don't error on bad regex, Oleh Krehel, 2015/05/01
- [elpa] master 0dd6c5a 27/31: ivy.el (ivy--regex): Fixup, Oleh Krehel, 2015/05/01
- [elpa] master fc84e0d 28/31: ivy.el (ivy-read): Reset `ivy-text' earlier, Oleh Krehel, 2015/05/01
- [elpa] master 5a1bd78 29/31: Improve TRAMP completion for ivy-mode, Oleh Krehel, 2015/05/01
- [elpa] master 5a2e0fd 30/31: Allow for "/ssh:user@" as well as for "/ssh:", Oleh Krehel, 2015/05/01
- [elpa] master 4137447 31/31: Merge commit '5a2e0fd355fea83e3c172402b965a1aa826fcc0c' from swiper, Oleh Krehel, 2015/05/01