-
-
Notifications
You must be signed in to change notification settings - Fork 84
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add OkLrab and OkLrCh Resolves #505 * Rebase accounting for null changes * Refactor to account for recent changes
- Loading branch information
1 parent
0c74920
commit 40e7a05
Showing
7 changed files
with
142 additions
and
3 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,37 @@ | ||
import ColorSpace from "../ColorSpace.js"; | ||
import OKLab from "./oklab.js"; | ||
import {toe, toeInv} from "./okhsl.js"; | ||
|
||
export default new ColorSpace({ | ||
id: "oklrab", | ||
name: "Oklrab", | ||
coords: { | ||
l: { | ||
refRange: [0, 1], | ||
name: "Lightness", | ||
}, | ||
a: { | ||
refRange: [-0.4, 0.4], | ||
}, | ||
b: { | ||
refRange: [-0.4, 0.4], | ||
}, | ||
}, | ||
|
||
// Note that XYZ is relative to D65 | ||
white: "D65", | ||
|
||
base: OKLab, | ||
fromBase (oklab) { | ||
return [toe(oklab[0]), oklab[1], oklab[2]]; | ||
}, | ||
toBase (oklrab) { | ||
return [toeInv(oklrab[0]), oklrab[1], oklrab[2]]; | ||
}, | ||
|
||
formats: { | ||
"color": { | ||
coords: ["<percentage> | <number>", "<number> | <percentage>[-1,1]", "<number> | <percentage>[-1,1]"], | ||
}, | ||
}, | ||
}); |
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,34 @@ | ||
import ColorSpace from "../ColorSpace.js"; | ||
import OKLrab from "./oklrab.js"; | ||
import lch from "./lch.js"; | ||
|
||
export default new ColorSpace({ | ||
id: "oklrch", | ||
name: "Oklrch", | ||
coords: { | ||
l: { | ||
refRange: [0, 1], | ||
name: "Lightness", | ||
}, | ||
c: { | ||
refRange: [0, 0.4], | ||
name: "Chroma", | ||
}, | ||
h: { | ||
refRange: [0, 360], | ||
type: "angle", | ||
name: "Hue", | ||
}, | ||
}, | ||
white: "D65", | ||
|
||
base: OKLrab, | ||
fromBase: lch.fromBase, | ||
toBase: lch.toBase, | ||
|
||
formats: { | ||
"color": { | ||
coords: ["<percentage> | <number>", "<number> | <percentage>[0,1]", "<number> | <angle>"], | ||
}, | ||
}, | ||
}); |
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,4 @@ | ||
declare const _default: ColorSpace; | ||
export default _default; | ||
import ColorSpace from "../ColorSpace.js"; | ||
//# sourceMappingURL=oklrab.d.ts.map |
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,4 @@ | ||
declare const _default: ColorSpace; | ||
export default _default; | ||
import ColorSpace from "../ColorSpace.js"; | ||
//# sourceMappingURL=oklrch.d.ts.map |