@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.
- package/dist/convertHextoCSSRGB.d.ts +1 -1
- package/dist/convertHextoRGB.d.ts +2 -2
- package/dist/getContrastRatioFromHex.d.ts +1 -1
- package/dist/getContrastRatioFromNamedCSSColour.d.ts +1 -1
- package/dist/getSRGBLuminanceFromHex.d.ts +1 -1
- package/dist/index.cjs +984 -646
- package/dist/index.min.js +1 -1
- package/dist/index.mjs +986 -683
- package/dist/pickHexColourContrast.d.ts +1 -1
- package/dist/sortHexColours.d.ts +1 -1
- package/package.json +3 -3
|
@@ -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;
|