[
{ "name": "halfway from black to white in OKLab is #636363, not #808080", "args": [["#000000", "#ffffff"], 0.5], "expect": "#636363" },
{ "name": "t = 0 is the first stop", "args": [["#000000", "#ffffff"], 0], "expect": "#000000" },
{ "name": "t = 1 is the last stop", "args": [["#000000", "#ffffff"], 1], "expect": "#ffffff" },
{ "name": "blue to yellow stays blue-green in the middle; mixing stored RGB gives grey #808080", "args": [["#0000ff", "#ffff00"], 0.5], "expect": "#6cabc7" },
{ "name": "an endpoint survives the round trip through OKLab", "args": [["#e69f00", "#56b4e9"], 0], "expect": "#e69f00" },
{ "name": "the other endpoint too", "args": [["#e69f00", "#56b4e9"], 1], "expect": "#56b4e9" },
{ "name": "a quarter of the way", "args": [["#e69f00", "#56b4e9"], 0.25], "expect": "#c9a868" },
{ "name": "red to green: the out-of-gamut blue is clipped to 0", "args": [["#ff0000", "#00ff00"], 0.5], "expect": "#d0a800" },
{ "name": "a diverging ramp's midpoint is its middle stop", "args": [["#2166ac", "#f7f7f7", "#b2182b"], 0.5], "expect": "#f7f7f7" },
{ "name": "a diverging ramp, a quarter along (inside the first segment)", "args": [["#2166ac", "#f7f7f7", "#b2182b"], 0.25], "expect": "#8eaed4" },
{ "name": "a diverging ramp, three quarters along (inside the second segment)", "args": [["#2166ac", "#f7f7f7", "#b2182b"], 0.75], "expect": "#dd928e" },
{ "name": "a diverging ramp's end", "args": [["#2166ac", "#f7f7f7", "#b2182b"], 1], "expect": "#b2182b" },
{ "name": "short hex and a descending ramp", "args": [["#fff", "#000"], 0.3], "expect": "#9e9e9e" },
{ "name": "white to red", "args": [["#ffffff", "#ff0000"], 0.5], "expect": "#ffa191" },
{ "name": "a viridis-like ramp near its start", "args": [["#440154", "#21918c", "#fde725"], 0.1], "expect": "#492860" },
{ "name": "one stop is not a ramp", "args": [["#000000"], 0.5], "expectError": "ramp needs at least 2 colours" },
{ "name": "t above 1 is an error", "args": [["#000000", "#ffffff"], 1.5], "expectError": "t must be between 0 and 1" },
{ "name": "t below 0 is an error", "args": [["#000000", "#ffffff"], -0.1], "expectError": "t must be between 0 and 1" },
{ "name": "a bad stop is an error", "args": [["#000000", "white"], 0.5], "expectError": "is not a hex colour" }
]