function setColorMode (colorMode) {
    const { active } = color // local copies for YUI compressor
    // {clientPath} = images,
    const hex = active.val('hex')
    let rgbMap; let rgbBar
    settings.color.mode = colorMode
    switch (colorMode) {
      case 'h':
        setTimeout(function () {
          setBG.call(that, colorMapDiv, 'transparent')
          setImgLoc.call(that, colorMapL1, 0)
          setAlpha.call(that, colorMapL1, 100)
          setImgLoc.call(that, colorMapL2, 260)
          setAlpha.call(that, colorMapL2, 100)
          setBG.call(that, colorBarDiv, 'transparent')
          setImgLoc.call(that, colorBarL1, 0)
          setAlpha.call(that, colorBarL1, 100)
          setImgLoc.call(that, colorBarL2, 260)
          setAlpha.call(that, colorBarL2, 100)
          setImgLoc.call(that, colorBarL3, 260)
          setAlpha.call(that, colorBarL3, 100)
          setImgLoc.call(that, colorBarL4, 260)
          setAlpha.call(that, colorBarL4, 100)
          setImgLoc.call(that, colorBarL6, 260)
          setAlpha.call(that, colorBarL6, 100)
        }, 0)
        colorMap.range('all', { minX: 0, maxX: 100, minY: 0, maxY: 100 })
        colorBar.range('rangeY', { minY: 0, maxY: 360 })
        if (isNullish(active.val('ahex'))) break
        colorMap.val('xy', { x: active.val('s'), y: 100 - active.val('v') }, colorMap)
        colorBar.val('y', 360 - active.val('h'), colorBar)
        break
      case 's':
        setTimeout(function () {
          setBG.call(that, colorMapDiv, 'transparent')
          setImgLoc.call(that, colorMapL1, -260)
          setImgLoc.call(that, colorMapL2, -520)
          setImgLoc.call(that, colorBarL1, -260)
          setImgLoc.call(that, colorBarL2, -520)
          setImgLoc.call(that, colorBarL6, 260)
          setAlpha.call(that, colorBarL6, 100)
        }, 0)
        colorMap.range('all', { minX: 0, maxX: 360, minY: 0, maxY: 100 })
        colorBar.range('rangeY', { minY: 0, maxY: 100 })
        if (isNullish(active.val('ahex'))) break
        colorMap.val('xy', { x: active.val('h'), y: 100 - active.val('v') }, colorMap)
        colorBar.val('y', 100 - active.val('s'), colorBar)
        break
      case 'v':
        setTimeout(function () {
          setBG.call(that, colorMapDiv, '000000')
          setImgLoc.call(that, colorMapL1, -780)
          setImgLoc.call(that, colorMapL2, 260)
          setBG.call(that, colorBarDiv, hex)
          setImgLoc.call(that, colorBarL1, -520)
          setImgLoc.call(that, colorBarL2, 260)
          setAlpha.call(that, colorBarL2, 100)
          setImgLoc.call(that, colorBarL6, 260)
          setAlpha.call(that, colorBarL6, 100)
        }, 0)
        colorMap.range('all', { minX: 0, maxX: 360, minY: 0, maxY: 100 })
        colorBar.range('rangeY', { minY: 0, maxY: 100 })
        if (isNullish(active.val('ahex'))) break
        colorMap.val('xy', { x: active.val('h'), y: 100 - active.val('s') }, colorMap)
        colorBar.val('y', 100 - active.val('v'), colorBar)
        break
      case 'r':
        rgbMap = -1040
        rgbBar = -780
        colorMap.range('all', { minX: 0, maxX: 255, minY: 0, maxY: 255 })
        colorBar.range('rangeY', { minY: 0, maxY: 255 })
        if (isNullish(active.val('ahex'))) break
        colorMap.val('xy', { x: active.val('b'), y: 255 - active.val('g') }, colorMap)
        colorBar.val('y', 255 - active.val('r'), colorBar)
        break
      case 'g':
        rgbMap = -1560
        rgbBar = -1820
        colorMap.range('all', { minX: 0, maxX: 255, minY: 0, maxY: 255 })
        colorBar.range('rangeY', { minY: 0, maxY: 255 })
        if (isNullish(active.val('ahex'))) break
        colorMap.val('xy', { x: active.val('b'), y: 255 - active.val('r') }, colorMap)
        colorBar.val('y', 255 - active.val('g'), colorBar)
        break
      case 'b':
        rgbMap = -2080
        rgbBar = -2860
        colorMap.range('all', { minX: 0, maxX: 255, minY: 0, maxY: 255 })
        colorBar.range('rangeY', { minY: 0, maxY: 255 })
        if (isNullish(active.val('ahex'))) break
        colorMap.val('xy', { x: active.val('r'), y: 255 - active.val('g') }, colorMap)
        colorBar.val('y', 255 - active.val('b'), colorBar)
        break
      case 'a':
        setTimeout(function () {
          setBG.call(that, colorMapDiv, 'transparent')
          setImgLoc.call(that, colorMapL1, -260)
          setImgLoc.call(that, colorMapL2, -520)
          setImgLoc.call(that, colorBarL1, 260)
          setImgLoc.call(that, colorBarL2, 260)
          setAlpha.call(that, colorBarL2, 100)
          setImgLoc.call(that, colorBarL6, 0)
          setAlpha.call(that, colorBarL6, 100)
        }, 0)
        colorMap.range('all', { minX: 0, maxX: 360, minY: 0, maxY: 100 })
        colorBar.range('rangeY', { minY: 0, maxY: 255 })
        if (isNullish(active.val('ahex'))) break
        colorMap.val('xy', { x: active.val('h'), y: 100 - active.val('v') }, colorMap)
        colorBar.val('y', 255 - active.val('a'), colorBar)
        break
      default:
        throw new Error('Invalid Mode')
    }
    switch (colorMode) {
      case 'h':
        break
      case 's':
      case 'v':
      case 'a':
        setTimeout(function () {
          setAlpha.call(that, colorMapL1, 100)
          setAlpha.call(that, colorBarL1, 100)
          setImgLoc.call(that, colorBarL3, 260)
          setAlpha.call(that, colorBarL3, 100)
          setImgLoc.call(that, colorBarL4, 260)
          setAlpha.call(that, colorBarL4, 100)
        }, 0)
        break
      case 'r':
      case 'g':
      case 'b':
        setTimeout(function () {
          setBG.call(that, colorMapDiv, 'transparent')
          setBG.call(that, colorBarDiv, 'transparent')
          setAlpha.call(that, colorBarL1, 100)
          setAlpha.call(that, colorMapL1, 100)
          setImgLoc.call(that, colorMapL1, rgbMap)
          setImgLoc.call(that, colorMapL2, rgbMap - 260)
          setImgLoc.call(that, colorBarL1, rgbBar - 780)
          setImgLoc.call(that, colorBarL2, rgbBar - 520)
          setImgLoc.call(that, colorBarL3, rgbBar)
          setImgLoc.call(that, colorBarL4, rgbBar - 260)
          setImgLoc.call(that, colorBarL6, 260)
          setAlpha.call(that, colorBarL6, 100)
        }, 0)
        break
    }
    if (isNullish(active.val('ahex'))) return
    activeColorChanged.call(that, active)
  }
@param {"h"|"s"|"v"|"r"|"g"|"b"|"a"} colorMode
@throws {Error} Invalid mode
@returns {void}