Skip to content

Commit e64ae48

Browse files
committed
remove colorSpace option
1 parent 173ed65 commit e64ae48

2 files changed

Lines changed: 1 addition & 10 deletions

File tree

src/legends.d.ts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -55,14 +55,6 @@ export interface RampLegendOptions {
5555
* crisp edges when rendering.
5656
*/
5757
round?: ScaleOptions["round"];
58-
59-
/**
60-
* The [color space][1] of the backing canvas. Defaults to *display-p3*,
61-
* allowing wide gamut colors; set to *srgb* if needed.
62-
*
63-
* [1]: https://developer.mozilla.org/en-US/docs/Web/API/ImageData/colorSpace
64-
*/
65-
colorSpace?: ImageData["colorSpace"];
6658
}
6759

6860
export interface OpacityLegendOptions extends RampLegendOptions {

src/legends/ramp.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ export function legendRamp(color, options) {
2121
fontVariant = inferFontVariant(color),
2222
round = true,
2323
opacity,
24-
colorSpace = "display-p3", // shouldn’t affect srgb, and allows wide gamut
2524
className
2625
} = options;
2726
const context = createContext(options);
@@ -91,7 +90,7 @@ export function legendRamp(color, options) {
9190
const canvas = context.document.createElement("canvas");
9291
canvas.width = n;
9392
canvas.height = 1;
94-
const context2 = canvas.getContext("2d", {colorSpace});
93+
const context2 = canvas.getContext("2d", {colorSpace: "display-p3"}); // allow wide gamut
9594
for (let i = 0, j = n - 1; i < n; ++i) {
9695
context2.fillStyle = interpolator(i / j);
9796
context2.fillRect(i, 0, 1, 1);

0 commit comments

Comments
 (0)