|
| 1 | +'use strict'; |
| 2 | + |
| 3 | +const test = require('mapbox-gl-js-test').test; |
| 4 | +const colorSpaces = require('../../../../src/style-spec/function/color_spaces'); |
| 5 | + |
| 6 | +test('#hclToRgb zero', (t) => { |
| 7 | + const hclColor = [0, 0, 0, null]; |
| 8 | + const rgbColor = [0, 0, 0, null]; |
| 9 | + t.deepEqual(colorSpaces.hcl.reverse(hclColor), rgbColor); |
| 10 | + t.end(); |
| 11 | +}); |
| 12 | + |
| 13 | +test('#hclToRgb', (t) => { |
| 14 | + const hclColor = [20, 20, 20, null]; |
| 15 | + const rgbColor = [76.04087881379073, 36.681898967046166, 39.08743507357837, null]; |
| 16 | + t.deepEqual(colorSpaces.hcl.reverse(hclColor), rgbColor); |
| 17 | + t.end(); |
| 18 | +}); |
| 19 | + |
| 20 | +test('#rgbToHcl zero', (t) => { |
| 21 | + const hclColor = [0, 0, 0, null]; |
| 22 | + const rgbColor = [0, 0, 0, null]; |
| 23 | + t.deepEqual(colorSpaces.hcl.forward(rgbColor), hclColor); |
| 24 | + t.end(); |
| 25 | +}); |
| 26 | + |
| 27 | +test('#rgbToHcl', (t) => { |
| 28 | + const hclColor = [158.19859051364818, 0.0000029334887311101764, 6.318928745123017, null]; |
| 29 | + const rgbColor = [20, 20, 20, null]; |
| 30 | + t.deepEqual(colorSpaces.hcl.forward(rgbColor), hclColor); |
| 31 | + t.end(); |
| 32 | +}); |
0 commit comments