Convert RGB to Hexadecimal

Description

This function converts RGB colours into hexadecimal.

It accepts an RGB object and converts it into a hexadecimal string.

Signature

function convertRGBtoHex(colour: RGBColour): string;

Example

import { convertRGBtoHex } from "@sardine/colour";

const hexColour = convertRGBtoHex({ R: 34, G: 250, B: 124 });
console.log(hexColour);
/* expects #22FA7C */