, result: 127},
    {input: ["0.5"], result: 127},
    {input: 1, result: "throws"},
    {input: {}, result: "throws"},
    {input: false, result: "throws"},
    {input: true, result: "throws"},
    {input: NaN, result: "throws"},
    {input: { valueOf() { return [1]; }}, result: "throws"},
  ];

  // A simple filter that just overrides the red channel if successful.
  function makeFilter(value) {
    return new CanvasFilter({
      filter: "componentTransfer",
      funcR: {type: "table", tableValues: valu