Function hexToMhvc

  • Converts hex color to Munsell HVC. Whether this conversion succeeds or not depends on the parameters though the following behaviour is guaranteed and tested on Node.js:

    If the optional parameters have default values,

    1. hexToMhvc() successfully returns Munsell HVC before maxIteration
    2. and the round-trip is invariant for 24-bit hex colors, i.e. mhvcToHex(hexToMhvc(hex)) returns the same hex color.

    See

    lchabToMhvc

    Parameters

    • hex: string

      may be 24-bit RGB (#XXXXXX), 12-bit RGB (#XXX), 32-bit RGBA, (#XXXXXXXX), or 16-bit RGBA (#XXXX). Alpha channel is ignored.

    • Optional rgbSpace: RGBSpace = SRGB
    • Optional threshold: number = 1e-6
    • Optional maxIteration: number = 200
    • Optional ifReachMax: ProcType = 'error'
    • Optional factor: number = 0.5

    Returns Vector3

    [Hue, Value, Chroma]

Generated using TypeDoc