<!DOCTYPE html><!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. --><metacharset="UTF-8"><htmlclass="reftest-wait"><linkrel="stylesheet"href="/html/canvas/resources/canvas-grid-reftest.css"><linkrel="match"href="2d.gradient.hueInterpolationMethod-expected.html"><metaname=fuzzycontent="maxDifference=0-1; totalPixels=0-60000"><title>Canvas test: 2d.gradient.hueInterpolationMethod</title><h1>2d.gradient.hueInterpolationMethod</h1><pclass="desc">CSS hue interpolation methods work for CanvasGradients</p><script>pending_tests=16;</script><divclass="grid-container"style="--grid-width: 4"><span><div>shorter</div><div>hsl</div><canvasclass="grid-cell-content"id="canvas0"width="100"height="50"><pclass="fallback">FAIL (fallback content)</p></canvas><scriptid="myWorker0"type="text/worker">self.onmessage=function(e){constcanvas=newOffscreenCanvas(100,50);constctx=canvas.getContext('2d');// Generate two gradients, one from red to green, the other from red to blue.// In the first instance "shorter" is equivalent to "increasing".// In the second, "shorter" is equivalent to "decreasing".varg=ctx.createLinearGradient(0,0,100,0);g.addColorStop(0,'color(srgb 1 0 0)');g.addColorStop(1,'color(srgb 0 1 0)');g.colorInterpolationMethod='hsl';g.hueInterpolationMethod='shorter';ctx.fillStyle=g;ctx.fillRect(0,0,100,25);varg2=ctx.createLinearGradient(0,0,100,0);g2.addColorStop(0,'color(srgb 1 0 0)');g2.addColorStop(1,'color(srgb 0 0 1)');g2.colorInterpolationMethod='hsl';g2.hueInterpolationMethod='shorter';ctx.fillStyle=g2;ctx.fillRect(0,25,100,25);constbitmap=canvas.transferToImageBitmap();self.postMessage(bitmap,bitmap);};</script><scripttype="module">constblob=newBlob([document.getElementById('myWorker0').textContent]);constworker=newWorker(URL.createObjectURL(blob));worker.addEventListener('message',msg=>{constoutputCanvas=document.getElementById('canvas0');constoutputCtx=outputCanvas.getContext('2d');outputCtx.drawImage(msg.data,0,0);if(--pending_tests==0){document.documentElement.classList.remove('reftest-wait');}});worker.postMessage(null);</script></span><span><div>longer</div><div>hsl</div><canvasclass="grid-cell-content"id="canvas1"width="100"height="50"><pclass="fallback">FAIL (fallback content)</p></canvas><scriptid="myWorker1"type="text/worker">self.onmessage=function(e){constcanvas=newOffscreenCanvas(100,50);constctx=canvas.getContext('2d');// Generate two gradients, one from red to green, the other from red to blue.// In the first instance "shorter" is equivalent to "increasing".// In the second, "shorter" is equivalent to "decreasing".varg=ctx.createLinearGradient(0,0,100,0);g.addColorStop(0,'color(srgb 1 0 0)');g.addColorStop(1,'color(srgb 0 1 0)');g.colorInterpolationMethod='hsl';g.hueInterpolationMethod='longer';ctx.fillStyle=g;ctx.fillRect(0,0,100,25);varg2=ctx.createLinearGradient(0,0,100,0);g2.addColorStop(0,'color(srgb 1 0 0)');g2.addColorStop(1,'color(srgb 0 0 1)');g2.colorInterpolationMethod='hsl';g2.hueInterpolationMethod='longer';ctx.fillStyle=g2;ctx.fillRect(0,25,100,25);constbitmap=canvas.transferToImageBitmap();self.postMessage(bitmap,bitmap);};</script><scripttype="module">constblob=newBlob([document.getElementById('myWorker1').textContent]);constworker=newWorker(URL.createObjectURL(blob));worker.addEventListener('message',msg=>{constoutputCanvas=document.getElementById('canvas1');constoutputCtx=outputCanvas.getContext('2d');outputCtx.drawImage(msg.data,0,0);if(--pending_tests==0){document.documentElement.classList.remove('reftest-wait');}});worker.postMessage(null);</script></span><span><div>increasing</div><div>hsl</div><canvasclass="grid-cell-content"id="canvas2"width="100"height="50"><pclass="fallback">FAIL (fallback content)</p></canvas><scriptid="myWorker2"type="text/worker">self.onmessage=function(e){constcanvas=newOffscreenCanvas(100,50);constctx=canvas.getContext('2d');// Generate two gradients, one from red to green, the other from red to blue.// In the first instance "shorter" is equivalent to "increasing".// In the second, "shorter" is equivalent to "decreasing".varg=ctx.createLinearGradient(0,0,100,0);g.addColorStop(0,'color(srgb 1 0 0)');g.addColorStop(1,'color(srgb 0 1 0)');g.colorInterpolationMethod='hsl';g.hueInterpolationMethod='increasing';ctx.fillStyle=g;ctx.fillRect(0,0,100,25);varg2=ctx.createLinearGradient(0,0,100,0);g2.addColorStop(0,'color(srgb 1 0 0)');g2.addColorStop(1,'color(srgb 0 0 1)');g2.colorInterpolationMethod='hsl';g2.hueInterpolationMethod='increasing';ctx.fillStyle=g2;ctx.fillRect(0,25,100,25);constbitmap=canvas.transferToImageBitmap();self.postMessage(bitmap,bitmap);};</script><scripttype="module">constblob=newBlob([document.getElementById('myWorker2').textContent]);constworker=newWorker(URL.createObjectURL(blob));worker.addEventListener('message',msg=>{constoutputCanvas=document.getElementById('canvas2');constoutputCtx=outputCanvas.getContext('2d');outputCtx.drawImage(msg.data,0,0);if(--pending_tests==0){document.documentElement.classList.remove('reftest-wait');}});worker.postMessage(null);</script></span><span><div>decreasing</div><div>hsl</div><canvasclass="grid-cell-content"id="canvas3"width="100"height="50"><pclass="fallback">FAIL (fallback content)</p></canvas><scriptid="myWorker3"type="text/worker">self.onmessage=function(e){constcanvas=newOffscreenCanvas(100,50);constctx=canvas.getContext('2d');// Generate two gradients, one from red to green, the other from red to blue.// In the first instance "shorter" is equivalent to "increasing".// In the second, "shorter" is equivalent to "decreasing".varg=ctx.createLinearGradient(0,0,100,0);g.addColorStop(0,'color(srgb 1 0 0)');g.addColorStop(1,'color(srgb 0 1 0)');g.colorInterpolationMethod='hsl';g.hueInterpolationMethod='decreasing';ctx.fillStyle=g;ctx.fillRect(0,0,100,25);varg2=ctx.createLinearGradient(0,0,100,0);g2.addColorStop(0,'color(srgb 1 0 0)');g2.addColorStop(1,'color(srgb 0 0 1)');g2.colorInterpolationMethod='hsl';g2.hueInterpolationMethod='decreasing';ctx.fillStyle=g2;ctx.fillRect(0,25,100,25);constbitmap=canvas.transferToImageBitmap();self.postMessage(bitmap,bitmap);};</script><scripttype="module">constblob=newBlob([document.getElementById('myWorker3').textContent]);constworker=newWorker(URL.createObjectURL(blob));worker.addEventListener('message',msg=>{constoutputCanvas=document.getElementById('canvas3');constoutputCtx=outputCanvas.getContext('2d');outputCtx.drawImage(msg.data,0,0);if(--pending_tests==0){document.documentElement.classList.remove('reftest-wait');}});worker.postMessage(null);</script></span><span><div>shorter</div><div>hwb</div><canvasclass="grid-cell-content"id="canvas4"width="100"height="50"><pclass="fallback">FAIL (fallback content)</p></canvas><scriptid="myWorker4"type="text/worker">self.onmessage=function(e){constcanvas=newOffscreenCanvas(100,50);constctx=canvas.getContext('2d');// Generate two gradients, one from red to green, the other from red to blue.// In the first instance "shorter" is equivalent to "increasing".// In the second, "shorter" is equivalent to "decreasing".varg=ctx.createLinearGradient(0,0,100,0);g.addColorStop(0,'color(srgb 1 0 0)');g.addColorStop(1,'color(srgb 0 1 0)');g.colorInterpolationMethod='hwb';g.hueInterpolationMethod='shorter';ctx.fillStyle=g;ctx.fillRect(0,0,100,25);varg2=ctx.createLinearGradient(0,0,100,0);g2.addColorStop(0,'color(srgb 1 0 0)');g2.addColorStop(1,'color(srgb 0 0 1)');g2.colorInterpolationMethod='hwb';g2.hueInterpolationMethod='shorter';ctx.fillStyle=g2;ctx.fillRect(0,25,100,25);constbitmap=canvas.transferToImageBitmap();self.postMessage(bitmap,bitmap);};</script><scripttype="module">constblob=newBlob([document.getElementById('myWorker4').textContent]);constworker=newWorker(URL.createObjectURL(blob));worker.addEventListener('message',msg=>{constoutputCanvas=document.getElementById('canvas4');constoutputCtx=outputCanvas.getContext('2d');outputCtx.drawImage(msg.data,0,0);if(--pending_tests==0){document.documentElement.classList.remove('reftest-wait');}});worker.postMessage(null);</script></span><span><div>longer</div><div>hwb</div><canvasclass="grid-cell-content"id="canvas5"width="100"height="50"><pclass="fallback">FAIL (fallback content)</p></canvas><scriptid="myWorker5"type="text/worker">self.onmessage=function(e){constcanvas=newOffscreenCanvas(100,50);constctx=canvas.getContext('2d');// Generate two gradients, one from red to green, the other from red to blue.// In the first instance "shorter" is equivalent to "increasing".// In the second, "shorter" is equivalent to "decreasing".varg=ctx.createLinearGradient(0,0,100,0);g.addColorStop(0,'color(srgb 1 0 0)');g.addColorStop(1,'color(srgb 0 1 0)');g.colorInterpolationMethod='hwb';g.hueInterpolationMethod='longer';ctx.fillStyle=g;ctx.fillRect(0,0,100,25);varg2=ctx.createLinearGradient(0,0,100,0);g2.addColorStop(0,'color(srgb 1 0 0)');g2.addColorStop(1,'color(srgb 0 0 1)');g2.colorInterpolationMethod='hwb';g2.hueInterpolationMethod='longer';ctx.fillStyle=g2;ctx.fillRect(0,25,100,25);constbitmap=canvas.transferToImageBitmap();self.postMessage(bitmap,bitmap);};</script><scripttype="module">constblob=newBlob([document.getElementById('myWorker5').textContent]);constworker=newWorker(URL.createObjectURL(blob));worker.addEventListener('message',msg=>{constoutputCanvas=document.getElementById('canvas5');constoutputCtx=outputCanvas.getContext('2d');outputCtx.drawImage(msg.data,0,0);if(--pending_tests==0){document.documentElement.classList.remove('reftest-wait');}});worker.postMessage(null);</script></span><span><div>increasing</div><div>hwb</div><canvasclass="grid-cell-content"id="canvas6"width="100"height="50"><pclass="fallback">FAIL (fallback content)</p></canvas><scriptid="myWorker6"type="text/worker">self.onmessage=function(e){constcanvas=newOffscreenCanvas(100,50);constctx=canvas.getContext('2d');// Generate two gradients, one from red to green, the other from red to blue.// In the first instance "shorter" is equivalent to "increasing".// In the second, "shorter" is equivalent to "decreasing".varg=ctx.createLinearGradient(0,0,100,0);g.addColorStop(0,'color(srgb 1 0 0)');g.addColorStop(1,'color(srgb 0 1 0)');g.colorInterpolationMethod='hwb';g.hueInterpolationMethod='increasing';ctx.fillStyle=g;ctx.fillRect(0,0,100,25);varg2=ctx.createLinearGradient(0,0,100,0);g2.addColorStop(0,'color(srgb 1 0 0)');g2.addColorStop(1,'color(srgb 0 0 1)');g2.colorInterpolationMethod='hwb';g2.hueInterpolationMethod='increasing';ctx.fillStyle=g2;ctx.fillRect(0,25,100,25);constbitmap=canvas.transferToImageBitmap();self.postMessage(bitmap,bitmap);};</script><scripttype="module">constblob=newBlob([document.getElementById('myWorker6').textContent]);constworker=newWorker(URL.createObjectURL(blob));worker.addEventListener('message',msg=>{constoutputCanvas=document.getElementById('canvas6');constoutputCtx=outputCanvas.getContext('2d');outputCtx.drawImage(msg.data,0,0);if(--pending_tests==0){document.documentElement.classList.remove('reftest-wait');}});worker.postMessage(null);</script></span><span><div>decreasing</div><div>hwb</div><canvasclass="grid-cell-content"id="canvas7"width="100"height="50"><pclass="fallback">FAIL (fallback content)</p></canvas><scriptid="myWorker7"type="text/worker">self.onmessage=function(e){constcanvas=newOffscreenCanvas(100,50);constctx=canvas.getContext('2d');// Generate two gradients, one from red to green, the other from red to blue.// In the first instance "shorter" is equivalent to "increasing".// In the second, "shorter" is equivalent to "decreasing".varg=ctx.createLinearGradient(0,0,100,0);g.addColorStop(0,'color(srgb 1 0 0)');g.addColorStop(1,'color(srgb 0 1 0)');g.colorInterpolationMethod='hwb';g.hueInterpolationMethod='decreasing';ctx.fillStyle=g;ctx.fillRect(0,0,100,25);varg2=ctx.createLinearGradient(0,0,100,0);g2.addColorStop(0,'color(srgb 1 0 0)');g2.addColorStop(1,'color(srgb 0 0 1)');g2.colorInterpolationMethod='hwb';g2.hueInterpolationMethod='decreasing';ctx.fillStyle=g2;ctx.fillRect(0,25,100,25);constbitmap=canvas.transferToImageBitmap();self.postMessage(bitmap,bitmap);};</script><scripttype="module">constblob=newBlob([document.getElementById('myWorker7').textContent]);constworker=newWorker(URL.createObjectURL(blob));worker.addEventListener('message',msg=>{constoutputCanvas=document.getElementById('canvas7');constoutputCtx=outputCanvas.getContext('2d');outputCtx.drawImage(msg.data,0,0);if(--pending_tests==0){document.documentElement.classList.remove('reftest-wait');}});worker.postMessage(null);</script></span><span><div>shorter</div><div>lch</div><canvasclass="grid-cell-content"id="canvas8"width="100"height="50"><pclass="fallback">FAIL (fallback content)</p></canvas><scriptid="myWorker8"type="text/worker">self.onmessage=function(e){constcanvas=newOffscreenCanvas(100,50);constctx=canvas.getContext('2d');// Generate two gradients, one from red to green, the other from red to blue.// In the first instance "shorter" is equivalent to "increasing".// In the second, "shorter" is equivalent to "decreasing".varg=ctx.createLinearGradient(0,0,100,0);g.addColorStop(0,'color(srgb 1 0 0)');g.addColorStop(1,'color(srgb 0 1 0)');g.colorInterpolationMethod='lch';g.hueInterpolationMethod='shorter';ctx.fillStyle=g;ctx.fillRect(0,0,100,25);varg2=ctx.createLinearGradient(0,0,100,0);g2.addColorStop(0,'color(srgb 1 0 0)');g2.addColorStop(1,'color(srgb 0 0 1)');g2.colorInterpolationMethod='lch';g2.hueInterpolationMethod='shorter';ctx.fillStyle=g2;ctx.fillRect(0,25,100,25);constbitmap=canvas.transferToImageBitmap();self.postMessage(bitmap,bitmap);};</script><scripttype="module">constblob=newBlob([document.getElementById('myWorker8').textContent]);constworker=newWorker(URL.createObjectURL(blob));worker.addEventListener('message',msg=>{constoutputCanvas=document.getElementById('canvas8');constoutputCtx=outputCanvas.getContext('2d');outputCtx.drawImage(msg.data,0,0);if(--pending_tests==0){document.documentElement.classList.remove('reftest-wait');}});worker.postMessage(null);</script></span><span><div>longer</div><div>lch</div><canvasclass="grid-cell-content"id="canvas9"width="100"height="50"><pclass="fallback">FAIL (fallback content)</p></canvas><scriptid="myWorker9"type="text/worker">self.onmessage=function(e){constcanvas=newOffscreenCanvas(100,50);constctx=canvas.getContext('2d');// Generate two gradients, one from red to green, the other from red to blue.// In the first instance "shorter" is equivalent to "increasing".// In the second, "shorter" is equivalent to "decreasing".varg=ctx.createLinearGradient(0,0,100,0);g.addColorStop(0,'color(srgb 1 0 0)');g.addColorStop(1,'color(srgb 0 1 0)');g.colorInterpolationMethod='lch';g.hueInterpolationMethod='longer';ctx.fillStyle=g;ctx.fillRect(0,0,100,25);varg2=ctx.createLinearGradient(0,0,100,0);g2.addColorStop(0,'color(srgb 1 0 0)');g2.addColorStop(1,'color(srgb 0 0 1)');g2.colorInterpolationMethod='lch';g2.hueInterpolationMethod='longer';ctx.fillStyle=g2;ctx.fillRect(0,25,100,25);constbitmap=canvas.transferToImageBitmap();self.postMessage(bitmap,bitmap);};</script><scripttype="module">constblob=newBlob([document.getElementById('myWorker9').textContent]);constworker=newWorker(URL.createObjectURL(blob));worker.addEventListener('message',msg=>{constoutputCanvas=document.getElementById('canvas9');constoutputCtx=outputCanvas.getContext('2d');outputCtx.drawImage(msg.data,0,0);if(--pending_tests==0){document.documentElement.classList.remove('reftest-wait');}});worker.postMessage(null);</script></span><span><div>increasing</div><div>lch</div><canvasclass="grid-cell-content"id="canvas10"width="100"height="50"><pclass="fallback">FAIL (fallback content)</p></canvas><scriptid="myWorker10"type="text/worker">self.onmessage=function(e){constcanvas=newOffscreenCanvas(100,50);constctx=canvas.getContext('2d');// Generate two gradients, one from red to green, the other from red to blue.// In the first instance "shorter" is equivalent to "increasing".// In the second, "shorter" is equivalent to "decreasing".varg=ctx.createLinearGradient(0,0,100,0);g.addColorStop(0,'color(srgb 1 0 0)');g.addColorStop(1,'color(srgb 0 1 0)');g.colorInterpolationMethod='lch';g.hueInterpolationMethod='increasing';ctx.fillStyle=g;ctx.fillRect(0,0,100,25);varg2=ctx.createLinearGradient(0,0,100,0);g2.addColorStop(0,'color(srgb 1 0 0)');g2.addColorStop(1,'color(srgb 0 0 1)');g2.colorInterpolationMethod='lch';g2.hueInterpolationMethod='increasing';ctx.fillStyle=g2;ctx.fillRect(0,25,100,25);constbitmap=canvas.transferToImageBitmap();self.postMessage(bitmap,bitmap);};</script><scripttype="module">constblob=newBlob([document.getElementById('myWorker10').textContent]);constworker=newWorker(URL.createObjectURL(blob));worker.addEventListener('message',msg=>{constoutputCanvas=document.getElementById('canvas10');constoutputCtx=outputCanvas.getContext('2d');outputCtx.drawImage(msg.data,0,0);if(--pending_tests==0){document.documentElement.classList.remove('reftest-wait');}});worker.postMessage(null);</script></span><span><div>decreasing</div><div>lch</div><canvasclass="grid-cell-content"id="canvas11"width="100"height="50"><pclass="fallback">FAIL (fallback content)</p></canvas><scriptid="myWorker11"type="text/worker">self.onmessage=function(e){constcanvas=newOffscreenCanvas(100,50);constctx=canvas.getContext('2d');// Generate two gradients, one from red to green, the other from red to blue.// In the first instance "shorter" is equivalent to "increasing".// In the second, "shorter" is equivalent to "decreasing".varg=ctx.createLinearGradient(0,0,100,0);g.addColorStop(0,'color(srgb 1 0 0)');g.addColorStop(1,'color(srgb 0 1 0)');g.colorInterpolationMethod='lch';g.hueInterpolationMethod='decreasing';ctx.fillStyle=g;ctx.fillRect(0,0,100,25);varg2=ctx.createLinearGradient(0,0,100,0);g2.addColorStop(0,'color(srgb 1 0 0)');g2.addColorStop(1,'color(srgb 0 0 1)');g2.colorInterpolationMethod='lch';g2.hueInterpolationMethod='decreasing';ctx.fillStyle=g2;ctx.fillRect(0,25,100,25);constbitmap=canvas.transferToImageBitmap();self.postMessage(bitmap,bitmap);};</script><scripttype="module">constblob=newBlob([document.getElementById('myWorker11').textContent]);constworker=newWorker(URL.createObjectURL(blob));worker.addEventListener('message',msg=>{constoutputCanvas=document.getElementById('canvas11');constoutputCtx=outputCanvas.getContext('2d');outputCtx.drawImage(msg.data,0,0);if(--pending_tests==0){document.documentElement.classList.remove('reftest-wait');}});worker.postMessage(null);</script></span><span><div>shorter</div><div>oklch</div><canvasclass="grid-cell-content"id="canvas12"width="100"height="50"><pclass="fallback">FAIL (fallback content)</p></canvas><scriptid="myWorker12"type="text/worker">self.onmessage=function(e){constcanvas=newOffscreenCanvas(100,50);constctx=canvas.getContext('2d');// Generate two gradients, one from red to green, the other from red to blue.// In the first instance "shorter" is equivalent to "increasing".// In the second, "shorter" is equivalent to "decreasing".varg=ctx.createLinearGradient(0,0,100,0);g.addColorStop(0,'color(srgb 1 0 0)');g.addColorStop(1,'color(srgb 0 1 0)');g.colorInterpolationMethod='oklch';g.hueInterpolationMethod='shorter';ctx.fillStyle=g;ctx.fillRect(0,0,100,25);varg2=ctx.createLinearGradient(0,0,100,0);g2.addColorStop(0,'color(srgb 1 0 0)');g2.addColorStop(1,'color(srgb 0 0 1)');g2.colorInterpolationMethod='oklch';g2.hueInterpolationMethod='shorter';ctx.fillStyle=g2;ctx.fillRect(0,25,100,25);constbitmap=canvas.transferToImageBitmap();self.postMessage(bitmap,bitmap);};</script><scripttype="module">constblob=newBlob([document.getElementById('myWorker12').textContent]);constworker=newWorker(URL.createObjectURL(blob));worker.addEventListener('message',msg=>{constoutputCanvas=document.getElementById('canvas12');constoutputCtx=outputCanvas.getContext('2d');outputCtx.drawImage(msg.data,0,0);if(--pending_tests==0){document.documentElement.classList.remove('reftest-wait');}});worker.postMessage(null);</script></span><span><div>longer</div><div>oklch</div><canvasclass="grid-cell-content"id="canvas13"width="100"height="50"><pclass="fallback">FAIL (fallback content)</p></canvas><scriptid="myWorker13"type="text/worker">self.onmessage=function(e){constcanvas=newOffscreenCanvas(100,50);constctx=canvas.getContext('2d');// Generate two gradients, one from red to green, the other from red to blue.// In the first instance "shorter" is equivalent to "increasing".// In the second, "shorter" is equivalent to "decreasing".varg=ctx.createLinearGradient(0,0,100,0);g.addColorStop(0,'color(srgb 1 0 0)');g.addColorStop(1,'color(srgb 0 1 0)');g.colorInterpolationMethod='oklch';g.hueInterpolationMethod='longer';ctx.fillStyle=g;ctx.fillRect(0,0,100,25);varg2=ctx.createLinearGradient(0,0,100,0);g2.addColorStop(0,'color(srgb 1 0 0)');g2.addColorStop(1,'color(srgb 0 0 1)');g2.colorInterpolationMethod='oklch';g2.hueInterpolationMethod='longer';ctx.fillStyle=g2;ctx.fillRect(0,25,100,25);constbitmap=canvas.transferToImageBitmap();self.postMessage(bitmap,bitmap);};</script><scripttype="module">constblob=newBlob([document.getElementById('myWorker13').textContent]);constworker=newWorker(URL.createObjectURL(blob));worker.addEventListener('message',msg=>{constoutputCanvas=document.getElementById('canvas13');constoutputCtx=outputCanvas.getContext('2d');outputCtx.drawImage(msg.data,0,0);if(--pending_tests==0){document.documentElement.classList.remove('reftest-wait');}});worker.postMessage(null);</script></span><span><div>increasing</div><div>oklch</div><canvasclass="grid-cell-content"id="canvas14"width="100"height="50"><pclass="fallback">FAIL (fallback content)</p></canvas><scriptid="myWorker14"type="text/worker">self.onmessage=function(e){constcanvas=newOffscreenCanvas(100,50);constctx=canvas.getContext('2d');// Generate two gradients, one from red to green, the other from red to blue.// In the first instance "shorter" is equivalent to "increasing".// In the second, "shorter" is equivalent to "decreasing".varg=ctx.createLinearGradient(0,0,100,0);g.addColorStop(0,'color(srgb 1 0 0)');g.addColorStop(1,'color(srgb 0 1 0)');g.colorInterpolationMethod='oklch';g.hueInterpolationMethod='increasing';ctx.fillStyle=g;ctx.fillRect(0,0,100,25);varg2=ctx.createLinearGradient(0,0,100,0);g2.addColorStop(0,'color(srgb 1 0 0)');g2.addColorStop(1,'color(srgb 0 0 1)');g2.colorInterpolationMethod='oklch';g2.hueInterpolationMethod='increasing';ctx.fillStyle=g2;ctx.fillRect(0,25,100,25);constbitmap=canvas.transferToImageBitmap();self.postMessage(bitmap,bitmap);};</script><scripttype="module">constblob=newBlob([document.getElementById('myWorker14').textContent]);constworker=newWorker(URL.createObjectURL(blob));worker.addEventListener('message',msg=>{constoutputCanvas=document.getElementById('canvas14');constoutputCtx=outputCanvas.getContext('2d');outputCtx.drawImage(msg.data,0,0);if(--pending_tests==0){document.documentElement.classList.remove('reftest-wait');}});worker.postMessage(null);</script></span><span><div>decreasing</div><div>oklch</div><canvasclass="grid-cell-content"id="canvas15"width="100"height="50"><pclass="fallback">FAIL (fallback content)</p></canvas><scriptid="myWorker15"type="text/worker">self.onmessage=function(e){constcanvas=newOffscreenCanvas(100,50);constctx=canvas.getContext('2d');// Generate two gradients, one from red to green, the other from red to blue.// In the first instance "shorter" is equivalent to "increasing".// In the second, "shorter" is equivalent to "decreasing".varg=ctx.createLinearGradient(0,0,100,0);g.addColorStop(0,'color(srgb 1 0 0)');g.addColorStop(1,'color(srgb 0 1 0)');g.colorInterpolationMethod='oklch';g.hueInterpolationMethod='decreasing';ctx.fillStyle=g;ctx.fillRect(0,0,100,25);varg2=ctx.createLinearGradient(0,0,100,0);g2.addColorStop(0,'color(srgb 1 0 0)');g2.addColorStop(1,'color(srgb 0 0 1)');g2.colorInterpolationMethod='oklch';g2.hueInterpolationMethod='decreasing';ctx.fillStyle=g2;ctx.fillRect(0,25,100,25);constbitmap=canvas.transferToImageBitmap();self.postMessage(bitmap,bitmap);};</script><scripttype="module">constblob=newBlob([document.getElementById('myWorker15').textContent]);constworker=newWorker(URL.createObjectURL(blob));worker.addEventListener('message',msg=>{constoutputCanvas=document.getElementById('canvas15');constoutputCtx=outputCanvas.getContext('2d');outputCtx.drawImage(msg.data,0,0);if(--pending_tests==0){document.documentElement.classList.remove('reftest-wait');}});worker.postMessage(null);</script></span></div></html>