Convert a named CSS colour to Hexadecimal
Description
Converts a named CSS Colour in an hexadecimal one.
List of colours sourced here: https://developer.mozilla.org/en-US/docs/Web/CSS/named-color
Returns undefined
if the colour is not found.
Signature
function convertNamedCSSColourtoHex(name: NamedCSSColour): string | undefined;
Example
import { convertNamedCSSColourtoHex } from "@sardine/colour";
const hexColour = convertNamedCSSColourtoHex("papayawhip");
console.log(hexColour);
// expects #FFEFD5