Function rgb255ToMhvc

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

    If r255, g255, and b255 are in {0, 1, ..., 255} and the optional parameters have default values,

    1. rgb255ToMhvc() successfully returns Munsell HVC before maxIteration
    2. and the round-trip is invariant, i.e. mhvcToRgb255(rgb255ToMhvc(r255, g255, b255)) returns [r255, g255, b255].

    See

    lchabToMhvc

    Parameters

    • r255: number

      will be in {0, 1, ..., 255} though any integer is accepted and properly processed as an out-of-gamut color.

    • g255: number

      ditto.

    • b255: number

      ditto.

    • 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