File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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
6860export interface OpacityLegendOptions extends RampLegendOptions {
Original file line number Diff line number Diff 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 ) ;
You can’t perform that action at this time.
0 commit comments