@sardine/colour 3.0.0 → 4.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -9,4 +9,4 @@
9
9
  *
10
10
  * @returns {string} either a CSS RGB or CSS RGBA string.
11
11
  */
12
- export declare function convertHextoCSSRGB(hex: string): string;
12
+ export declare function convertHextoCSSRGB(hex: string): string | null;
@@ -8,6 +8,6 @@ import type { RGBColour } from "./types";
8
8
  * - `#ffff`
9
9
  * - `#102030ff`
10
10
  *
11
- * @returns {RGBColour} RGB colour object.
11
+ * @returns {RGBColour | null} RGB colour object, or `null` if the input is not a valid hexadecimal colour.
12
12
  */
13
- export declare function convertHextoRGB(hex: string): RGBColour;
13
+ export declare function convertHextoRGB(hex: string): RGBColour | null;
@@ -6,4 +6,4 @@ import type { WCAG } from "./types";
6
6
  * @param standard The standard to evaluate the contrast ratio against, defaults to WCAG2.1
7
7
  * @returns The contrast ratio between the two colours truncated to 3 decimal places
8
8
  */
9
- export declare function getContrastRatioFromHex(colour1: string, colour2: string, standard: WCAG): number;
9
+ export declare function getContrastRatioFromHex(colour1: string, colour2: string, standard: WCAG): number | null;
@@ -8,4 +8,4 @@ import type { NamedCSSColour, WCAG } from "./types";
8
8
  * @param standard The standard to evaluate the contrast ratio against, defaults to WCAG2.1
9
9
  * @returns The contrast ratio between the two colours truncated to 3 decimal places
10
10
  */
11
- export declare function getContrastRatioFromNamedCSSColour(colour1: NamedCSSColour, colour2: NamedCSSColour, standard: WCAG): number;
11
+ export declare function getContrastRatioFromNamedCSSColour(colour1: NamedCSSColour, colour2: NamedCSSColour, standard: WCAG): number | null;
@@ -10,4 +10,4 @@ import type { WCAG } from "./types";
10
10
  * https://www.w3.org/WAI/GL/wiki/Relative_luminance
11
11
  * @param colour an hexadecimal colour
12
12
  */
13
- export declare function getSRGBLuminanceFromHex(colour: string, standard?: WCAG): number;
13
+ export declare function getSRGBLuminanceFromHex(colour: string, standard?: WCAG): number | null;