Convert Hexadecimal to named CSS colour
Description
The convertHextoNamedCSSColour
function is designed to convert a hexadecimal color value into its corresponding named CSS color. It utilizes a predefined list of named CSS colors, mapping each color to its hexadecimal representation.
Signature
function convertHextoNamedCSSColour(colour: string): NamedCSSColour | undefined;
Example
import { convertHextoNamedCSSColour } from "@sardine/colour";
const hexColour = "#7fff00";
const namedColour = convertHextoNamedCSSColour(hexColour);
console.log(namedColour);
// expects chartreuse