-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: CIELAB colorspace and CIEDE2000 distance algorithm (#1)
* feat: add CIELAB and DIN99 colorspaces and distance algorithms * fix: a couple of sigil tests * chore: bump version to 0.4.0 * test: add nearest color algorithm test to CIELAB colorspace struct * feat: add `RGB.grayscale?/1` * feat: Add color analytic functions * docs: update readme with supported color spaces * feat: add rose color category to RGB module * fix: improve color categories * WIP: add color table script * WIP: add LCh color space * WIP: update color table script * feat: add Delta E CIEDE2000 algorithm * fix: CIELAB to LCh conversion * add CIEDE2000 distance algorithm * fix: CIEDE2000 algorithm * fix: CIEDE2000 distance calculation * refactor: remove LCh colorspace * refactor: move distance algorithms to another folder * fix: tests * refactor: clean up * refactor: rename CIELAB to Lab * refactor: restructure protocols * docs: improve readme * fix: format in test file * refactor: distance algorithms behavior * feat: add distance cache * fix: improve performance and allow DistanceCache to be not running * fix: improve precision for XYZ colorspace * feat: add `HSV.grayscale?/1` * feat: add `RGB.grayish?/2` * fix: use `Mix.Config` rather than `Config` * test: implement missing test for all modules * fix: allow distance algorithms to get any color type as first arg * docs: add missing docs * chore: bump version * chore: remove script * fix: docs since * chore: remove Elixir 1.7 from officially supported versions * chore: temporarily remove Elixir 1.10 from travis config
- Loading branch information
Showing
65 changed files
with
2,663 additions
and
487 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import Tint.Sigil | ||
|
||
alias Tint.Distance | ||
|
||
color = ~K[#FF0000] | ||
other_color = ~K[#00FF00] | ||
color_in_lab = Tint.to_lab(color) | ||
other_color_in_lab = Tint.to_lab(other_color) | ||
|
||
Benchee.run(%{ | ||
"RGB Delta E" => fn -> | ||
Distance.Euclidean.distance(color, other_color, []) | ||
end, | ||
"CIEDE2000" => fn -> | ||
Distance.CIEDE2000.distance(color_in_lab, other_color_in_lab, []) | ||
end | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
use Mix.Config | ||
|
||
config :tint, distance_cache_size: 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
use Mix.Config | ||
|
||
config :tint, distance_cache_size: 100 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
defmodule Tint.Application do | ||
@moduledoc false | ||
|
||
use Application | ||
|
||
def start(_type, _args) do | ||
children = [ | ||
Tint.DistanceCache | ||
] | ||
|
||
Supervisor.start_link( | ||
children, | ||
strategy: :one_for_one, | ||
name: Tint.Supervisor | ||
) | ||
end | ||
end |
Oops, something went wrong.