@basiclines/rampa-sdk 1.5.1 → 1.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cube-color-space.d.ts +7 -0
- package/dist/index.js +4 -0
- package/package.json +1 -1
|
@@ -12,6 +12,9 @@ import type { InterpolationMode, CubeColorSpaceResult } from './types';
|
|
|
12
12
|
* y: '#f9e2af', m: '#cba6f7', c: '#94e2d5', w: '#cdd6f4',
|
|
13
13
|
* }).size(6);
|
|
14
14
|
*
|
|
15
|
+
* // With different interpolation:
|
|
16
|
+
* const space2 = new CubeColorSpace({ ... }).interpolation('lab').size(6);
|
|
17
|
+
*
|
|
15
18
|
* space.r(4) // → ColorResult (single-axis shortcut)
|
|
16
19
|
* space.tint({ r: 3, b: 2 }) // → ColorResult (multi-axis)
|
|
17
20
|
* space.cube(3, 0, 2) // → ColorResult (raw coordinates)
|
|
@@ -27,6 +30,10 @@ export declare class CubeColorSpace {
|
|
|
27
30
|
constructor(corners: Record<string, string>, options?: {
|
|
28
31
|
interpolation?: InterpolationMode;
|
|
29
32
|
});
|
|
33
|
+
/**
|
|
34
|
+
* Set the interpolation mode.
|
|
35
|
+
*/
|
|
36
|
+
interpolation(mode: InterpolationMode): this;
|
|
30
37
|
/**
|
|
31
38
|
* Set the steps per axis and return the color space accessor object.
|
|
32
39
|
*/
|
package/dist/index.js
CHANGED
|
@@ -8031,6 +8031,10 @@ class CubeColorSpace {
|
|
|
8031
8031
|
this._corners = corners;
|
|
8032
8032
|
this._interpolation = options?.interpolation ?? "oklch";
|
|
8033
8033
|
}
|
|
8034
|
+
interpolation(mode) {
|
|
8035
|
+
this._interpolation = mode;
|
|
8036
|
+
return this;
|
|
8037
|
+
}
|
|
8034
8038
|
size(stepsPerAxis) {
|
|
8035
8039
|
const keys = Object.keys(this._corners);
|
|
8036
8040
|
const cornerColors = keys.map((k3) => this._corners[k3]);
|