function val (name, value, context) {
      // Kind of ugly
      const set = Boolean(value)
      if (set && value.ahex === '') value.ahex = '00000000'
      if (!set) {
        let ret
        if (isNullish(name) || name === '') name = 'all'
        if (isNullish(r)) return null
        switch (name.toLowerCase()) {
          case 'ahex': return ColorMethods.rgbaToHex({ r, g, b, a })
          case 'hex': return val('ahex').substring(0, 6)
          case 'all': return {
            r,
            g,
            b,
            a,
            h,
            s,
            v,
            hex: val.call(that, 'hex'),
            ahex: val.call(that, 'ahex')
          }
          default: {
            ret = {}
            const nameLength = name.length;
            [...name].forEach((ch) => {
              switch (ch) {
                case 'r':
                  if (nameLength === 1) ret = r
                  else ret.r = r
                  break
                case 'g':
                  if (nameLength === 1) ret = g
                  else ret.g = g
                  break
                case 'b':
                  if (nameLength === 1) ret = b
                  else ret.b = b
                  break
                case 'a':
                  if (nameLength === 1) ret = a
                  else ret.a = a
                  break
                case 'h':
                  if (nameLength === 1) ret = h
                  else ret.h = h
                  break
                case 's':
                  if (nameLength === 1) ret = s
                  else ret.s = s
                  break
                case 'v':
                  if (nameLength === 1) ret = v
                  else ret.v = v
                  break
              }
            })
          }
        }
        return typeof ret === 'object' && !Object.keys(ret).length
          ? val.call(that, 'all')
          : ret
      }
      if (!isNullish(context) && context === that) return undefined
      if (isNullish(name)) name = ''

      let changed = false
      if (isNullish(value)) {
        if (!isNullish(r)) {
          r = null
          changed = true
        }
        if (!isNullish(g)) {
          g = null
          changed = true
        }
        if (!isNullish(b)) {
          b = null
          changed = true
        }
        if (!isNullish(a)) {
          a = null
          changed = true
        }
        if (!isNullish(h)) {
          h = null
          changed = true
        }
        if (!isNullish(s)) {
          s = null
          changed = true
        }
        if (!isNullish(v)) {
          v = null
          changed = true
        }
        changed && fireChangeEvents.call(that, context || that)
        return undefined
      }
      switch (name.toLowerCase()) {
        case 'ahex':
        case 'hex': {
          const ret = ColorMethods.hexToRgba((value && (value.ahex || value.hex)) || value || 'none')
          val.call(that, 'rgba', {
            r: ret.r,
            g: ret.g,
            b: ret.b,
            a: name === 'ahex'
              ? ret.a
              : !isNullish(a)
                  ? a
                  : 255
          }, context)
          break
        } default: {
          if (value && (!isNullish(value.ahex) || !isNullish(value.hex))) {
            val.call(that, 'ahex', value.ahex || value.hex || '00000000', context)
            return undefined
          }
          const newV = {}
          let rgb = false; let hsv = false
          if (value.r !== undefined && !name.includes('r')) name += 'r'
          if (value.g !== undefined && !name.includes('g')) name += 'g'
          if (value.b !== undefined && !name.includes('b')) name += 'b'
          if (value.a !== undefined && !name.includes('a')) name += 'a'
          if (value.h !== undefined && !name.includes('h')) name += 'h'
          if (value.s !== undefined && !name.includes('s')) name += 's'
          if (value.v !== undefined && !name.includes('v')) name += 'v';
          [...name].forEach((ch) => {
            switch (ch) {
              case 'r':
                if (hsv) return
                rgb = true
                newV.r = (value.r && value.r | 0) || (value | 0) || 0
                if (newV.r < 0) newV.r = 0
                else if (newV.r > 255) newV.r = 255
                if (r !== newV.r) {
                  ({ r } = newV)
                  changed = true
                }
                break
              case 'g':
                if (hsv) return
                rgb = true
                newV.g = (value && value.g && value.g | 0) || (value && value | 0) || 0
                if (newV.g < 0) newV.g = 0
                else if (newV.g > 255) newV.g = 255
                if (g !== newV.g) {
                  ({ g } = newV)
                  changed = true
                }
                break
              case 'b':
                if (hsv) return
                rgb = true
                newV.b = (value && value.b && value.b | 0) || (value && value | 0) || 0
                if (newV.b < 0) newV.b = 0
                else if (newV.b > 255) newV.b = 255
                if (b !== newV.b) {
                  ({ b } = newV)
                  changed = true
                }
                break
              case 'a':
                newV.a = value && !isNullish(value.a) ? value.a | 0 : value | 0
                if (newV.a < 0) newV.a = 0
                else if (newV.a > 255) newV.a = 255
                if (a !== newV.a) {
                  ({ a } = newV)
                  changed = true
                }
                break
              case 'h':
                if (rgb) return
                hsv = true
                newV.h = (value && value.h && value.h | 0) || (value && value | 0) || 0
                if (newV.h < 0) newV.h = 0
                else if (newV.h > 360) newV.h = 360
                if (h !== newV.h) {
                  ({ h } = newV)
                  changed = true
                }
                break
              case 's':
                if (rgb) return
                hsv = true
                newV.s = !isNullish(value.s) ? value.s | 0 : value | 0
                if (newV.s < 0) newV.s = 0
                else if (newV.s > 100) newV.s = 100
                if (s !== newV.s) {
                  ({ s } = newV)
                  changed = true
                }
                break
              case 'v':
                if (rgb) return
                hsv = true
                newV.v = !isNullish(value.v) ? value.v | 0 : value | 0
                if (newV.v < 0) newV.v = 0
                else if (newV.v > 100) newV.v = 100
                if (v !== newV.v) {
                  ({ v } = newV)
                  changed = true
                }
                break
            }
          })
          if (changed) {
            if (rgb) {
              r = r || 0
              g = g || 0
              b = b || 0
              const ret = ColorMethods.rgbToHsv({ r, g, b });
              ({ h, s, v } = ret)
            } else if (hsv) {
              h = h || 0
              s = !isNullish(s) ? s : 100
              v = !isNullish(v) ? v : 100
              const ret = ColorMethods.hsvToRgb({ h, s, v });
              ({ r, g, b } = ret)
            }
            a = !isNullish(a) ? a : 255
            fireChangeEvents.call(that, context || that)
          }
          break
        }
      }
      return undefined
    }
@param {string|"ahex"|"hex"|"all"|""|null|void} name String composed of letters "r", "g", "b", "a", "h", "s", and/or "v"
@param {module:jPicker.RGBA|module:jPicker.JPickerInit|string} [value]
@param {external:jQuery.jPicker.Color} context
@returns {module:jPicker.JPickerInit|string|null|void}