@yookue/ts-lang-utils
    Preparing search index...

    Function rgbToHex

    • Returns the converted hex color from the given rgb color

      Parameters

      • Optionalrgb: string | [r: number, g: number, b: number]

        the rgb color to inspect

      Returns undefined | string

      the converted hex color from the given rgb color

      David Hsing

      rgbToHex('rgb(255, 0, 0)');    // '#ff0000'
      rgbToHex([255, 0, 0]); // '#ff0000'