@instructure/ui-color-utils 11.7.3 → 11.7.4-pr-snapshot-1781695314229

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/CHANGELOG.md CHANGED
@@ -3,6 +3,14 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [11.7.4-pr-snapshot-1781695314229](https://github.com/instructure/instructure-ui/compare/v11.7.3...v11.7.4-pr-snapshot-1781695314229) (2026-06-17)
7
+
8
+ **Note:** Version bump only for package @instructure/ui-color-utils
9
+
10
+
11
+
12
+
13
+
6
14
  ## [11.7.3](https://github.com/instructure/instructure-ui/compare/v11.7.2...v11.7.3) (2026-05-07)
7
15
 
8
16
 
package/LICENSE.md CHANGED
@@ -2,6 +2,7 @@
2
2
  title: The MIT License (MIT)
3
3
  category: Getting Started
4
4
  order: 9
5
+ isWIP: true
5
6
  ---
6
7
 
7
8
  # The MIT License (MIT)
@@ -1,11 +1,3 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports.isValid = isValid;
8
- var _tinycolor = _interopRequireDefault(require("tinycolor2"));
9
1
  /*
10
2
  * The MIT License (MIT)
11
3
  *
@@ -30,15 +22,15 @@ var _tinycolor = _interopRequireDefault(require("tinycolor2"));
30
22
  * SOFTWARE.
31
23
  */
32
24
 
33
- /**
34
- * ---
35
- * category: utilities/Color
36
- * ---
37
- * check if a string is a valid color
38
- * @module isValid
39
- * @param color
40
- * @returns true if the string is a valid color
41
- */
42
- function isValid(color) {
43
- return (0, _tinycolor.default)(color).isValid();
44
- }
25
+ module.exports = {
26
+ presets: [
27
+ [
28
+ require('@instructure/ui-babel-preset'),
29
+ {
30
+ esModules: Boolean(process.env.ES_MODULES),
31
+ removeConsole: process.env.NODE_ENV === 'production',
32
+ transformImports: Boolean(process.env.TRANSFORM_IMPORTS)
33
+ }
34
+ ]
35
+ ]
36
+ }
@@ -21,9 +21,11 @@
21
21
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
22
  * SOFTWARE.
23
23
  */
24
- import { colorToRGB, colorToHex8 } from "./conversions.js";
25
- import { overlayColors } from "./overlayColors.js";
26
- import { contrast } from "./contrast.js";
24
+
25
+ import { colorToRGB, colorToHex8 } from './conversions.js';
26
+ import { overlayColors } from './overlayColors.js';
27
+ import { contrast } from './contrast.js';
28
+
27
29
  /**
28
30
  * ---
29
31
  * category: utilities/Color
package/es/index.js CHANGED
@@ -21,16 +21,19 @@
21
21
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
22
  * SOFTWARE.
23
23
  */
24
- export { alpha } from "./alpha.js";
25
- export { darken } from "./darken.js";
26
- export { lighten } from "./lighten.js";
27
- export { contrast } from "./contrast.js";
28
- export { isValid } from "./isValid.js";
29
- export { overlayColors } from "./overlayColors.js";
30
- export { contrastWithAlpha } from "./contrastWithAlpha.js";
31
- export { validateContrast } from "./validateContrast.js";
32
- export { color2hex, colorToHex8, colorToHsva, colorToHsla, colorToRGB } from "./conversions.js";
33
- import { color2hex, colorToHex8, colorToHsva, colorToHsla, colorToRGB } from "./conversions.js"; // TODO remove when we get rid of babel-plugin-transform-imports
24
+
25
+ export { alpha } from './alpha.js';
26
+ export { darken } from './darken.js';
27
+ export { lighten } from './lighten.js';
28
+ export { contrast } from './contrast.js';
29
+ export { isValid } from './isValid.js';
30
+ export { overlayColors } from './overlayColors.js';
31
+ export { contrastWithAlpha } from './contrastWithAlpha.js';
32
+ export { validateContrast } from './validateContrast.js';
33
+ export { color2hex, colorToHex8, colorToHsva, colorToHsla, colorToRGB } from './conversions.js';
34
+ import { color2hex, colorToHex8, colorToHsva, colorToHsla, colorToRGB } from './conversions.js';
35
+
36
+ // TODO remove when we get rid of babel-plugin-transform-imports
34
37
  // This default export is needed because babel-plugin-transform-imports will
35
38
  // fail if the exported name is not the same as the filename
36
39
  export default {
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@instructure/ui-color-utils",
3
- "version": "11.7.3",
3
+ "version": "11.7.4-pr-snapshot-1781695314229",
4
+ "type": "module",
4
5
  "description": "A color utility library made by Instructure Inc.",
5
6
  "author": "Instructure, Inc. Engineering and Product Design",
6
7
  "module": "./es/index.js",
7
- "main": "./lib/index.js",
8
8
  "types": "./types/index.d.ts",
9
9
  "repository": {
10
10
  "type": "git",
@@ -19,7 +19,7 @@
19
19
  },
20
20
  "devDependencies": {
21
21
  "@types/tinycolor2": "^1.4.6",
22
- "@instructure/ui-babel-preset": "11.7.3"
22
+ "@instructure/ui-babel-preset": "11.7.4-pr-snapshot-1781695314229"
23
23
  },
24
24
  "publishConfig": {
25
25
  "access": "public"
@@ -30,10 +30,8 @@
30
30
  "src": "./src/index.ts",
31
31
  "types": "./types/index.d.ts",
32
32
  "import": "./es/index.js",
33
- "require": "./lib/index.js",
34
33
  "default": "./es/index.js"
35
34
  },
36
- "./lib/*": "./lib/*",
37
35
  "./es/*": "./es/*",
38
36
  "./types/*": "./types/*",
39
37
  "./package.json": "./package.json",
@@ -43,7 +41,7 @@
43
41
  "lint": "ui-scripts lint",
44
42
  "lint:fix": "ui-scripts lint --fix",
45
43
  "clean": "ui-scripts clean",
46
- "build": "ui-scripts build --modules es,cjs",
44
+ "build": "ui-scripts build",
47
45
  "build:watch": "ui-scripts build --watch",
48
46
  "build:types": "tsc -p tsconfig.build.json"
49
47
  }
@@ -22,9 +22,9 @@
22
22
  * SOFTWARE.
23
23
  */
24
24
 
25
- import { colorToRGB, colorToHex8 } from './conversions'
26
- import { overlayColors } from './overlayColors'
27
- import { contrast } from './contrast'
25
+ import { colorToRGB, colorToHex8 } from './conversions.js'
26
+ import { overlayColors } from './overlayColors.js'
27
+ import { contrast } from './contrast.js'
28
28
 
29
29
  /**
30
30
  * ---
package/src/index.ts CHANGED
@@ -22,21 +22,21 @@
22
22
  * SOFTWARE.
23
23
  */
24
24
 
25
- export { alpha } from './alpha'
26
- export { darken } from './darken'
27
- export { lighten } from './lighten'
28
- export { contrast } from './contrast'
29
- export { isValid } from './isValid'
30
- export { overlayColors } from './overlayColors'
31
- export { contrastWithAlpha } from './contrastWithAlpha'
32
- export { validateContrast } from './validateContrast'
25
+ export { alpha } from './alpha.js'
26
+ export { darken } from './darken.js'
27
+ export { lighten } from './lighten.js'
28
+ export { contrast } from './contrast.js'
29
+ export { isValid } from './isValid.js'
30
+ export { overlayColors } from './overlayColors.js'
31
+ export { contrastWithAlpha } from './contrastWithAlpha.js'
32
+ export { validateContrast } from './validateContrast.js'
33
33
  export {
34
34
  color2hex,
35
35
  colorToHex8,
36
36
  colorToHsva,
37
37
  colorToHsla,
38
38
  colorToRGB
39
- } from './conversions'
39
+ } from './conversions.js'
40
40
 
41
41
  import {
42
42
  color2hex,
@@ -44,7 +44,7 @@ import {
44
44
  colorToHsva,
45
45
  colorToHsla,
46
46
  colorToRGB
47
- } from './conversions'
47
+ } from './conversions.js'
48
48
 
49
49
  // TODO remove when we get rid of babel-plugin-transform-imports
50
50
  // This default export is needed because babel-plugin-transform-imports will
@@ -1 +1 @@
1
- {"fileNames":["../../node_modules/typescript/lib/lib.es5.d.ts","../../node_modules/typescript/lib/lib.es2015.d.ts","../../node_modules/typescript/lib/lib.es2016.d.ts","../../node_modules/typescript/lib/lib.es2017.d.ts","../../node_modules/typescript/lib/lib.es2018.d.ts","../../node_modules/typescript/lib/lib.es2019.d.ts","../../node_modules/typescript/lib/lib.dom.d.ts","../../node_modules/typescript/lib/lib.dom.iterable.d.ts","../../node_modules/typescript/lib/lib.es2015.core.d.ts","../../node_modules/typescript/lib/lib.es2015.collection.d.ts","../../node_modules/typescript/lib/lib.es2015.generator.d.ts","../../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../node_modules/typescript/lib/lib.es2015.promise.d.ts","../../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../node_modules/typescript/lib/lib.es2016.intl.d.ts","../../node_modules/typescript/lib/lib.es2017.arraybuffer.d.ts","../../node_modules/typescript/lib/lib.es2017.date.d.ts","../../node_modules/typescript/lib/lib.es2017.object.d.ts","../../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../node_modules/typescript/lib/lib.es2017.string.d.ts","../../node_modules/typescript/lib/lib.es2017.intl.d.ts","../../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../node_modules/typescript/lib/lib.es2018.intl.d.ts","../../node_modules/typescript/lib/lib.es2018.promise.d.ts","../../node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../node_modules/typescript/lib/lib.es2019.array.d.ts","../../node_modules/typescript/lib/lib.es2019.object.d.ts","../../node_modules/typescript/lib/lib.es2019.string.d.ts","../../node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../node_modules/typescript/lib/lib.es2019.intl.d.ts","../../node_modules/typescript/lib/lib.decorators.d.ts","../../node_modules/typescript/lib/lib.decorators.legacy.d.ts","../../node_modules/@types/react/global.d.ts","../../node_modules/csstype/index.d.ts","../../node_modules/@types/prop-types/index.d.ts","../../node_modules/@types/react/index.d.ts","../../node_modules/@types/react/jsx-runtime.d.ts","../../node_modules/@emotion/sheet/dist/declarations/src/index.d.ts","../../node_modules/@emotion/sheet/dist/emotion-sheet.cjs.d.mts","../../node_modules/@emotion/utils/dist/declarations/src/types.d.ts","../../node_modules/@emotion/utils/dist/declarations/src/index.d.ts","../../node_modules/@emotion/utils/dist/emotion-utils.cjs.d.mts","../../node_modules/@emotion/serialize/dist/declarations/src/index.d.ts","../../node_modules/@emotion/serialize/dist/emotion-serialize.cjs.d.mts","../../node_modules/@emotion/react/dist/declarations/src/types.d.ts","../../node_modules/@emotion/react/dist/declarations/src/theming.d.ts","../../node_modules/@emotion/react/dist/declarations/src/jsx-namespace.d.ts","../../node_modules/@emotion/react/dist/declarations/src/jsx-runtime.d.ts","../../node_modules/@emotion/react/jsx-runtime/dist/emotion-react-jsx-runtime.cjs.d.mts","../../node_modules/@types/tinycolor2/index.d.ts","./src/alpha.ts","./src/colorTypes.ts","./src/contrast.ts","./src/conversions.ts","./src/overlayColors.ts","./src/contrastWithAlpha.ts","./src/darken.ts","./src/lighten.ts","./src/isValid.ts","./src/validateContrast.ts","./src/index.ts"],"fileIdsList":[[42,50,52],[42,43,53],[42,51],[53],[54],[40,48],[49],[44],[46],[45],[47],[39,40,41],[42],[55,56],[55],[55,59,60,61],[55,57,58,59,60,61,62,63,64,65,66],[55,58]],"fileInfos":[{"version":"bcd24271a113971ba9eb71ff8cb01bc6b0f872a85c23fdbe5d93065b375933cd","affectsGlobalScope":true,"impliedFormat":1},{"version":"3f88bedbeb09c6f5a6645cb24c7c55f1aa22d19ae96c8e6959cbd8b85a707bc6","impliedFormat":1},{"version":"7fe93b39b810eadd916be8db880dd7f0f7012a5cc6ffb62de8f62a2117fa6f1f","impliedFormat":1},{"version":"bb0074cc08b84a2374af33d8bf044b80851ccc9e719a5e202eacf40db2c31600","impliedFormat":1},{"version":"1a7daebe4f45fb03d9ec53d60008fbf9ac45a697fdc89e4ce218bc94b94f94d6","impliedFormat":1},{"version":"f94b133a3cb14a288803be545ac2683e0d0ff6661bcd37e31aaaec54fc382aed","impliedFormat":1},{"version":"d6b1eba8496bdd0eed6fc8a685768fe01b2da4a0388b5fe7df558290bffcf32f","affectsGlobalScope":true,"impliedFormat":1},{"version":"7f57fc4404ff020bc45b9c620aff2b40f700b95fe31164024c453a5e3c163c54","impliedFormat":1},{"version":"eadcffda2aa84802c73938e589b9e58248d74c59cb7fcbca6474e3435ac15504","affectsGlobalScope":true,"impliedFormat":1},{"version":"105ba8ff7ba746404fe1a2e189d1d3d2e0eb29a08c18dded791af02f29fb4711","affectsGlobalScope":true,"impliedFormat":1},{"version":"00343ca5b2e3d48fa5df1db6e32ea2a59afab09590274a6cccb1dbae82e60c7c","affectsGlobalScope":true,"impliedFormat":1},{"version":"ebd9f816d4002697cb2864bea1f0b70a103124e18a8cd9645eeccc09bdf80ab4","affectsGlobalScope":true,"impliedFormat":1},{"version":"2c1afac30a01772cd2a9a298a7ce7706b5892e447bb46bdbeef720f7b5da77ad","affectsGlobalScope":true,"impliedFormat":1},{"version":"7b0225f483e4fa685625ebe43dd584bb7973bbd84e66a6ba7bbe175ee1048b4f","affectsGlobalScope":true,"impliedFormat":1},{"version":"c0a4b8ac6ce74679c1da2b3795296f5896e31c38e888469a8e0f99dc3305de60","affectsGlobalScope":true,"impliedFormat":1},{"version":"3084a7b5f569088e0146533a00830e206565de65cae2239509168b11434cd84f","affectsGlobalScope":true,"impliedFormat":1},{"version":"c5079c53f0f141a0698faa903e76cb41cd664e3efb01cc17a5c46ec2eb0bef42","affectsGlobalScope":true,"impliedFormat":1},{"version":"32cafbc484dea6b0ab62cf8473182bbcb23020d70845b406f80b7526f38ae862","affectsGlobalScope":true,"impliedFormat":1},{"version":"fca4cdcb6d6c5ef18a869003d02c9f0fd95df8cfaf6eb431cd3376bc034cad36","affectsGlobalScope":true,"impliedFormat":1},{"version":"b93ec88115de9a9dc1b602291b85baf825c85666bf25985cc5f698073892b467","affectsGlobalScope":true,"impliedFormat":1},{"version":"f5c06dcc3fe849fcb297c247865a161f995cc29de7aa823afdd75aaaddc1419b","affectsGlobalScope":true,"impliedFormat":1},{"version":"b77e16112127a4b169ef0b8c3a4d730edf459c5f25fe52d5e436a6919206c4d7","affectsGlobalScope":true,"impliedFormat":1},{"version":"fbffd9337146eff822c7c00acbb78b01ea7ea23987f6c961eba689349e744f8c","affectsGlobalScope":true,"impliedFormat":1},{"version":"a995c0e49b721312f74fdfb89e4ba29bd9824c770bbb4021d74d2bf560e4c6bd","affectsGlobalScope":true,"impliedFormat":1},{"version":"c7b3542146734342e440a84b213384bfa188835537ddbda50d30766f0593aff9","affectsGlobalScope":true,"impliedFormat":1},{"version":"ce6180fa19b1cccd07ee7f7dbb9a367ac19c0ed160573e4686425060b6df7f57","affectsGlobalScope":true,"impliedFormat":1},{"version":"3f02e2476bccb9dbe21280d6090f0df17d2f66b74711489415a8aa4df73c9675","affectsGlobalScope":true,"impliedFormat":1},{"version":"45e3ab34c1c013c8ab2dc1ba4c80c780744b13b5676800ae2e3be27ae862c40c","affectsGlobalScope":true,"impliedFormat":1},{"version":"805c86f6cca8d7702a62a844856dbaa2a3fd2abef0536e65d48732441dde5b5b","affectsGlobalScope":true,"impliedFormat":1},{"version":"e42e397f1a5a77994f0185fd1466520691456c772d06bf843e5084ceb879a0ad","affectsGlobalScope":true,"impliedFormat":1},{"version":"f4c2b41f90c95b1c532ecc874bd3c111865793b23aebcc1c3cbbabcd5d76ffb0","affectsGlobalScope":true,"impliedFormat":1},{"version":"ab26191cfad5b66afa11b8bf935ef1cd88fabfcb28d30b2dfa6fad877d050332","affectsGlobalScope":true,"impliedFormat":1},{"version":"2088bc26531e38fb05eedac2951480db5309f6be3fa4a08d2221abb0f5b4200d","affectsGlobalScope":true,"impliedFormat":1},{"version":"cb9d366c425fea79716a8fb3af0d78e6b22ebbab3bd64d25063b42dc9f531c1e","affectsGlobalScope":true,"impliedFormat":1},{"version":"500934a8089c26d57ebdb688fc9757389bb6207a3c8f0674d68efa900d2abb34","affectsGlobalScope":true,"impliedFormat":1},{"version":"689da16f46e647cef0d64b0def88910e818a5877ca5379ede156ca3afb780ac3","affectsGlobalScope":true,"impliedFormat":1},{"version":"1ce14b81c5cc821994aa8ec1d42b220dd41b27fcc06373bce3958af7421b77d4","affectsGlobalScope":true,"impliedFormat":1},{"version":"b3a048b3e9302ef9a34ef4ebb9aecfb28b66abb3bce577206a79fee559c230da","affectsGlobalScope":true,"impliedFormat":1},{"version":"eb5b19b86227ace1d29ea4cf81387279d04bb34051e944bc53df69f58914b788","affectsGlobalScope":true,"impliedFormat":1},{"version":"ac51dd7d31333793807a6abaa5ae168512b6131bd41d9c5b98477fc3b7800f9f","impliedFormat":1},{"version":"87d9d29dbc745f182683f63187bf3d53fd8673e5fca38ad5eaab69798ed29fbc","impliedFormat":1},{"version":"7a3aa194cfd5919c4da251ef04ea051077e22702638d4edcb9579e9101653519","affectsGlobalScope":true,"impliedFormat":1},{"version":"42c169fb8c2d42f4f668c624a9a11e719d5d07dacbebb63cbcf7ef365b0a75b3","impliedFormat":1},{"version":"4dcdbdbc992d114e52247e2f960b05cf9d65d3142114bf08552b18938cb3d56b","impliedFormat":1},{"version":"b75d56703daaffcb31a7cdebf190856e07739a9481f01c2919f95bde99be9424","impliedFormat":99},{"version":"ddb5454371b8da3a72ec536ad319f9f4e0a9851ffa961ae174484296a88a70db","impliedFormat":1},{"version":"fb7c8a2d7e2b50ada1e15b223d3bb83690bd34fd764aa0e009918549e440db1d","impliedFormat":1},{"version":"b75d56703daaffcb31a7cdebf190856e07739a9481f01c2919f95bde99be9424","impliedFormat":99},{"version":"1fa33d8db2a9d2a7dbfb7a24718cccbcde8364d10cce29b1a7eea4cf3a530cbb","impliedFormat":1},{"version":"b75d56703daaffcb31a7cdebf190856e07739a9481f01c2919f95bde99be9424","impliedFormat":99},{"version":"381437930df37907c030519b23ffea4d8113f46e4431a70bfe008a0c43c63648","impliedFormat":1},{"version":"695cbb89013bc9e87fb24b0df020fe605c54f0ab5c267b5bf0490ed097044197","impliedFormat":1},{"version":"f43780383543bfcdc0a2ee850375e1f03d94bdb1b85091d5b11bb8b2023c8b49","impliedFormat":1},{"version":"977a7d9e35d24211f02d8f6fd3a60db8c289b50cacbed38a50d5b49133e76e9f","impliedFormat":1},{"version":"ea93c204a5d0c681048fe6c4554b8d23b3312f79cf99744ff42668896af975e3","impliedFormat":99},{"version":"10281654231a4dfa1a41af0415afbd6d0998417959aed30c9f0054644ce10f5c","impliedFormat":1},{"version":"670458b319af5284a03484515515dc767b4edb8a8b53496802aea33e4ce0559b","signature":"5ea7e132185cbcbda2f6586f0d2035e6f5c8d00120c1e4233166b2a512ef0712"},{"version":"7ff197f6cd9b7e06e6a39dac7b1e15676b750b6d263cfeb5c9da7e89d22eb022","signature":"c97486ce003fdcebccd6e04b217751fedde1458ca7bd494ad42f529d870f39b3"},{"version":"90cda91f98ba216f71dd2d0f7bf843abb0f6ae4d88003a259f296cd1a3321e47","signature":"7cacc75b147e49e73382142849f3a9cac15fc2cdb1a5f3d7697f5536119a27df"},{"version":"cfdd7fe24246cc29ebf91f02eddae253ab6687579737abbb825b4c0c0513b8fe","signature":"1c976414117af0d66499c1f8e58c810ee464853b7c6bc5b3097629db6b7b0738"},{"version":"e9df5e3bc74e7f127ef6ec5e4b0507f65c0248aab355e49970a925af0e4976f4","signature":"72b4027529e7b71d28da0a32dcfe3e47ffa8c022ced60c1dbcf50d644ead6b34"},{"version":"5198142723cbfb722270ccade3b32ff2d87c935114ed1f285d6b17fd7e9280fc","signature":"16fb031c15c5b6b80267dbc8b4254a5fa1c1f585104604ee9ba1d7e50ce42f42"},{"version":"9f56fd6ab6039fcd73359348f94ae3e4628de97d258bc181c8b1785d1ac4001f","signature":"f94ca68c32a1ecb4e9ef76b70e12c363bb98c99522639bae7d4e73bf055744d9"},{"version":"7369df9c0505a6c2354ec0fb31716d235b470da247d35cbd84e070e4bcbc1709","signature":"5852b17bb355c5f9587d98d98035ca82c3208d92655988480c5525a17c1da1d0"},{"version":"8884e338f9f21faa8342e9e68043718b04859b2a75b06bade06e85f5ed74349f","signature":"4cd651567a57f09723b59168900cb70d390338e9daddfda34c5e2347b7fb5185"},{"version":"1078252c8d17f47efa1948475fce7858271dfefd70130a5dcb1bd21bca9cbbe4","signature":"95df3de83b00947cd4c4c15cbf3fc53a796fc3c0ee5f6602a1acd3206998f069"},{"version":"23861f0c3db8ebb657f2cecc5dc01942abe2cfd31acede9c4f8565e0f670774c","signature":"0773ef22422cb20ff5f44c66460ec30ceba869dd5f6dcbbd9f12790d7a9c59e9"}],"root":[[57,67]],"options":{"allowJs":true,"allowSyntheticDefaultImports":true,"checkJs":false,"composite":true,"declaration":true,"declarationMap":true,"emitDeclarationOnly":true,"esModuleInterop":true,"experimentalDecorators":true,"jsx":4,"jsxImportSource":"@emotion/react","module":99,"noFallthroughCasesInSwitch":true,"noImplicitAny":true,"noImplicitReturns":true,"noUnusedLocals":true,"noUnusedParameters":true,"outDir":"./types","rootDir":"./src","skipLibCheck":true,"strict":true,"target":2},"referencedMap":[[53,1],[54,2],[52,3],[51,4],[55,5],[49,6],[50,7],[45,8],[47,9],[46,10],[48,11],[42,12],[43,13],[57,14],[58,15],[59,14],[62,16],[60,14],[63,14],[67,17],[65,14],[64,14],[61,18],[66,15]],"latestChangedDtsFile":"./types/index.d.ts","version":"6.0.3"}
1
+ {"fileNames":["../../node_modules/typescript/lib/lib.es5.d.ts","../../node_modules/typescript/lib/lib.es2015.d.ts","../../node_modules/typescript/lib/lib.es2016.d.ts","../../node_modules/typescript/lib/lib.es2017.d.ts","../../node_modules/typescript/lib/lib.es2018.d.ts","../../node_modules/typescript/lib/lib.es2019.d.ts","../../node_modules/typescript/lib/lib.dom.d.ts","../../node_modules/typescript/lib/lib.dom.iterable.d.ts","../../node_modules/typescript/lib/lib.es2015.core.d.ts","../../node_modules/typescript/lib/lib.es2015.collection.d.ts","../../node_modules/typescript/lib/lib.es2015.generator.d.ts","../../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../node_modules/typescript/lib/lib.es2015.promise.d.ts","../../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../node_modules/typescript/lib/lib.es2016.intl.d.ts","../../node_modules/typescript/lib/lib.es2017.arraybuffer.d.ts","../../node_modules/typescript/lib/lib.es2017.date.d.ts","../../node_modules/typescript/lib/lib.es2017.object.d.ts","../../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../node_modules/typescript/lib/lib.es2017.string.d.ts","../../node_modules/typescript/lib/lib.es2017.intl.d.ts","../../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../node_modules/typescript/lib/lib.es2018.intl.d.ts","../../node_modules/typescript/lib/lib.es2018.promise.d.ts","../../node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../node_modules/typescript/lib/lib.es2019.array.d.ts","../../node_modules/typescript/lib/lib.es2019.object.d.ts","../../node_modules/typescript/lib/lib.es2019.string.d.ts","../../node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../node_modules/typescript/lib/lib.es2019.intl.d.ts","../../node_modules/typescript/lib/lib.decorators.d.ts","../../node_modules/typescript/lib/lib.decorators.legacy.d.ts","../../node_modules/@types/react/global.d.ts","../../node_modules/csstype/index.d.ts","../../node_modules/@types/prop-types/index.d.ts","../../node_modules/@types/react/index.d.ts","../../node_modules/@types/react/jsx-runtime.d.ts","../../node_modules/@emotion/sheet/dist/declarations/src/index.d.ts","../../node_modules/@emotion/sheet/dist/emotion-sheet.cjs.d.mts","../../node_modules/@emotion/utils/dist/declarations/src/types.d.ts","../../node_modules/@emotion/utils/dist/declarations/src/index.d.ts","../../node_modules/@emotion/utils/dist/emotion-utils.cjs.d.mts","../../node_modules/@emotion/serialize/dist/declarations/src/index.d.ts","../../node_modules/@emotion/serialize/dist/emotion-serialize.cjs.d.mts","../../node_modules/@emotion/react/dist/declarations/src/types.d.ts","../../node_modules/@emotion/react/dist/declarations/src/theming.d.ts","../../node_modules/@emotion/react/dist/declarations/src/jsx-namespace.d.ts","../../node_modules/@emotion/react/dist/declarations/src/jsx-runtime.d.ts","../../node_modules/@emotion/react/jsx-runtime/dist/emotion-react-jsx-runtime.cjs.d.mts","../../node_modules/@types/tinycolor2/index.d.ts","./src/alpha.ts","./src/colorTypes.ts","./src/contrast.ts","./src/conversions.ts","./src/overlayColors.ts","./src/contrastWithAlpha.ts","./src/darken.ts","./src/lighten.ts","./src/isValid.ts","./src/validateContrast.ts","./src/index.ts"],"fileIdsList":[[42,50,52],[42,43,53],[42,51],[53],[54],[40,48],[49],[44],[46],[45],[47],[39,40,41],[42],[55,56],[55],[55,59,60,61],[55,57,58,59,60,61,62,63,64,65,66],[55,58]],"fileInfos":[{"version":"bcd24271a113971ba9eb71ff8cb01bc6b0f872a85c23fdbe5d93065b375933cd","affectsGlobalScope":true,"impliedFormat":1},{"version":"3f88bedbeb09c6f5a6645cb24c7c55f1aa22d19ae96c8e6959cbd8b85a707bc6","impliedFormat":1},{"version":"7fe93b39b810eadd916be8db880dd7f0f7012a5cc6ffb62de8f62a2117fa6f1f","impliedFormat":1},{"version":"bb0074cc08b84a2374af33d8bf044b80851ccc9e719a5e202eacf40db2c31600","impliedFormat":1},{"version":"1a7daebe4f45fb03d9ec53d60008fbf9ac45a697fdc89e4ce218bc94b94f94d6","impliedFormat":1},{"version":"f94b133a3cb14a288803be545ac2683e0d0ff6661bcd37e31aaaec54fc382aed","impliedFormat":1},{"version":"d6b1eba8496bdd0eed6fc8a685768fe01b2da4a0388b5fe7df558290bffcf32f","affectsGlobalScope":true,"impliedFormat":1},{"version":"7f57fc4404ff020bc45b9c620aff2b40f700b95fe31164024c453a5e3c163c54","impliedFormat":1},{"version":"eadcffda2aa84802c73938e589b9e58248d74c59cb7fcbca6474e3435ac15504","affectsGlobalScope":true,"impliedFormat":1},{"version":"105ba8ff7ba746404fe1a2e189d1d3d2e0eb29a08c18dded791af02f29fb4711","affectsGlobalScope":true,"impliedFormat":1},{"version":"00343ca5b2e3d48fa5df1db6e32ea2a59afab09590274a6cccb1dbae82e60c7c","affectsGlobalScope":true,"impliedFormat":1},{"version":"ebd9f816d4002697cb2864bea1f0b70a103124e18a8cd9645eeccc09bdf80ab4","affectsGlobalScope":true,"impliedFormat":1},{"version":"2c1afac30a01772cd2a9a298a7ce7706b5892e447bb46bdbeef720f7b5da77ad","affectsGlobalScope":true,"impliedFormat":1},{"version":"7b0225f483e4fa685625ebe43dd584bb7973bbd84e66a6ba7bbe175ee1048b4f","affectsGlobalScope":true,"impliedFormat":1},{"version":"c0a4b8ac6ce74679c1da2b3795296f5896e31c38e888469a8e0f99dc3305de60","affectsGlobalScope":true,"impliedFormat":1},{"version":"3084a7b5f569088e0146533a00830e206565de65cae2239509168b11434cd84f","affectsGlobalScope":true,"impliedFormat":1},{"version":"c5079c53f0f141a0698faa903e76cb41cd664e3efb01cc17a5c46ec2eb0bef42","affectsGlobalScope":true,"impliedFormat":1},{"version":"32cafbc484dea6b0ab62cf8473182bbcb23020d70845b406f80b7526f38ae862","affectsGlobalScope":true,"impliedFormat":1},{"version":"fca4cdcb6d6c5ef18a869003d02c9f0fd95df8cfaf6eb431cd3376bc034cad36","affectsGlobalScope":true,"impliedFormat":1},{"version":"b93ec88115de9a9dc1b602291b85baf825c85666bf25985cc5f698073892b467","affectsGlobalScope":true,"impliedFormat":1},{"version":"f5c06dcc3fe849fcb297c247865a161f995cc29de7aa823afdd75aaaddc1419b","affectsGlobalScope":true,"impliedFormat":1},{"version":"b77e16112127a4b169ef0b8c3a4d730edf459c5f25fe52d5e436a6919206c4d7","affectsGlobalScope":true,"impliedFormat":1},{"version":"fbffd9337146eff822c7c00acbb78b01ea7ea23987f6c961eba689349e744f8c","affectsGlobalScope":true,"impliedFormat":1},{"version":"a995c0e49b721312f74fdfb89e4ba29bd9824c770bbb4021d74d2bf560e4c6bd","affectsGlobalScope":true,"impliedFormat":1},{"version":"c7b3542146734342e440a84b213384bfa188835537ddbda50d30766f0593aff9","affectsGlobalScope":true,"impliedFormat":1},{"version":"ce6180fa19b1cccd07ee7f7dbb9a367ac19c0ed160573e4686425060b6df7f57","affectsGlobalScope":true,"impliedFormat":1},{"version":"3f02e2476bccb9dbe21280d6090f0df17d2f66b74711489415a8aa4df73c9675","affectsGlobalScope":true,"impliedFormat":1},{"version":"45e3ab34c1c013c8ab2dc1ba4c80c780744b13b5676800ae2e3be27ae862c40c","affectsGlobalScope":true,"impliedFormat":1},{"version":"805c86f6cca8d7702a62a844856dbaa2a3fd2abef0536e65d48732441dde5b5b","affectsGlobalScope":true,"impliedFormat":1},{"version":"e42e397f1a5a77994f0185fd1466520691456c772d06bf843e5084ceb879a0ad","affectsGlobalScope":true,"impliedFormat":1},{"version":"f4c2b41f90c95b1c532ecc874bd3c111865793b23aebcc1c3cbbabcd5d76ffb0","affectsGlobalScope":true,"impliedFormat":1},{"version":"ab26191cfad5b66afa11b8bf935ef1cd88fabfcb28d30b2dfa6fad877d050332","affectsGlobalScope":true,"impliedFormat":1},{"version":"2088bc26531e38fb05eedac2951480db5309f6be3fa4a08d2221abb0f5b4200d","affectsGlobalScope":true,"impliedFormat":1},{"version":"cb9d366c425fea79716a8fb3af0d78e6b22ebbab3bd64d25063b42dc9f531c1e","affectsGlobalScope":true,"impliedFormat":1},{"version":"500934a8089c26d57ebdb688fc9757389bb6207a3c8f0674d68efa900d2abb34","affectsGlobalScope":true,"impliedFormat":1},{"version":"689da16f46e647cef0d64b0def88910e818a5877ca5379ede156ca3afb780ac3","affectsGlobalScope":true,"impliedFormat":1},{"version":"1ce14b81c5cc821994aa8ec1d42b220dd41b27fcc06373bce3958af7421b77d4","affectsGlobalScope":true,"impliedFormat":1},{"version":"b3a048b3e9302ef9a34ef4ebb9aecfb28b66abb3bce577206a79fee559c230da","affectsGlobalScope":true,"impliedFormat":1},{"version":"eb5b19b86227ace1d29ea4cf81387279d04bb34051e944bc53df69f58914b788","affectsGlobalScope":true,"impliedFormat":1},{"version":"ac51dd7d31333793807a6abaa5ae168512b6131bd41d9c5b98477fc3b7800f9f","impliedFormat":1},{"version":"87d9d29dbc745f182683f63187bf3d53fd8673e5fca38ad5eaab69798ed29fbc","impliedFormat":1},{"version":"7a3aa194cfd5919c4da251ef04ea051077e22702638d4edcb9579e9101653519","affectsGlobalScope":true,"impliedFormat":1},{"version":"42c169fb8c2d42f4f668c624a9a11e719d5d07dacbebb63cbcf7ef365b0a75b3","impliedFormat":1},{"version":"4dcdbdbc992d114e52247e2f960b05cf9d65d3142114bf08552b18938cb3d56b","impliedFormat":1},{"version":"b75d56703daaffcb31a7cdebf190856e07739a9481f01c2919f95bde99be9424","impliedFormat":99},{"version":"ddb5454371b8da3a72ec536ad319f9f4e0a9851ffa961ae174484296a88a70db","impliedFormat":1},{"version":"fb7c8a2d7e2b50ada1e15b223d3bb83690bd34fd764aa0e009918549e440db1d","impliedFormat":1},{"version":"b75d56703daaffcb31a7cdebf190856e07739a9481f01c2919f95bde99be9424","impliedFormat":99},{"version":"1fa33d8db2a9d2a7dbfb7a24718cccbcde8364d10cce29b1a7eea4cf3a530cbb","impliedFormat":1},{"version":"b75d56703daaffcb31a7cdebf190856e07739a9481f01c2919f95bde99be9424","impliedFormat":99},{"version":"381437930df37907c030519b23ffea4d8113f46e4431a70bfe008a0c43c63648","impliedFormat":1},{"version":"695cbb89013bc9e87fb24b0df020fe605c54f0ab5c267b5bf0490ed097044197","impliedFormat":1},{"version":"f43780383543bfcdc0a2ee850375e1f03d94bdb1b85091d5b11bb8b2023c8b49","impliedFormat":1},{"version":"977a7d9e35d24211f02d8f6fd3a60db8c289b50cacbed38a50d5b49133e76e9f","impliedFormat":1},{"version":"ea93c204a5d0c681048fe6c4554b8d23b3312f79cf99744ff42668896af975e3","impliedFormat":99},{"version":"10281654231a4dfa1a41af0415afbd6d0998417959aed30c9f0054644ce10f5c","impliedFormat":1},{"version":"670458b319af5284a03484515515dc767b4edb8a8b53496802aea33e4ce0559b","signature":"5ea7e132185cbcbda2f6586f0d2035e6f5c8d00120c1e4233166b2a512ef0712"},{"version":"7ff197f6cd9b7e06e6a39dac7b1e15676b750b6d263cfeb5c9da7e89d22eb022","signature":"c97486ce003fdcebccd6e04b217751fedde1458ca7bd494ad42f529d870f39b3"},{"version":"90cda91f98ba216f71dd2d0f7bf843abb0f6ae4d88003a259f296cd1a3321e47","signature":"7cacc75b147e49e73382142849f3a9cac15fc2cdb1a5f3d7697f5536119a27df"},{"version":"cfdd7fe24246cc29ebf91f02eddae253ab6687579737abbb825b4c0c0513b8fe","signature":"1c976414117af0d66499c1f8e58c810ee464853b7c6bc5b3097629db6b7b0738"},{"version":"e9df5e3bc74e7f127ef6ec5e4b0507f65c0248aab355e49970a925af0e4976f4","signature":"72b4027529e7b71d28da0a32dcfe3e47ffa8c022ced60c1dbcf50d644ead6b34"},{"version":"e384074a4da4d2a4197f3559fc9fc5150f0b302c4345d066f788d44e5d0e477a","signature":"16fb031c15c5b6b80267dbc8b4254a5fa1c1f585104604ee9ba1d7e50ce42f42"},{"version":"9f56fd6ab6039fcd73359348f94ae3e4628de97d258bc181c8b1785d1ac4001f","signature":"f94ca68c32a1ecb4e9ef76b70e12c363bb98c99522639bae7d4e73bf055744d9"},{"version":"7369df9c0505a6c2354ec0fb31716d235b470da247d35cbd84e070e4bcbc1709","signature":"5852b17bb355c5f9587d98d98035ca82c3208d92655988480c5525a17c1da1d0"},{"version":"8884e338f9f21faa8342e9e68043718b04859b2a75b06bade06e85f5ed74349f","signature":"4cd651567a57f09723b59168900cb70d390338e9daddfda34c5e2347b7fb5185"},{"version":"1078252c8d17f47efa1948475fce7858271dfefd70130a5dcb1bd21bca9cbbe4","signature":"95df3de83b00947cd4c4c15cbf3fc53a796fc3c0ee5f6602a1acd3206998f069"},{"version":"134074f5aa270d95590ae5f4a61efb5d221c652efd9bd0f6fd5cc7f16718eb7d","signature":"87e30b401a8a334ca3dbd310f713d0fc7bd403a1a942c50dec9d7ca0904ae9fd"}],"root":[[57,67]],"options":{"allowJs":true,"allowSyntheticDefaultImports":true,"checkJs":false,"composite":true,"declaration":true,"declarationMap":true,"emitDeclarationOnly":true,"esModuleInterop":true,"experimentalDecorators":true,"jsx":4,"jsxImportSource":"@emotion/react","module":99,"noFallthroughCasesInSwitch":true,"noImplicitAny":true,"noImplicitReturns":true,"noUnusedLocals":true,"noUnusedParameters":true,"outDir":"./types","rootDir":"./src","skipLibCheck":true,"strict":true,"target":2},"referencedMap":[[53,1],[54,2],[52,3],[51,4],[55,5],[49,6],[50,7],[45,8],[47,9],[46,10],[48,11],[42,12],[43,13],[57,14],[58,15],[59,14],[62,16],[60,14],[63,14],[67,17],[65,14],[64,14],[61,18],[66,15]],"latestChangedDtsFile":"./types/index.d.ts","version":"6.0.3"}
package/types/index.d.ts CHANGED
@@ -1,12 +1,12 @@
1
- export { alpha } from './alpha';
2
- export { darken } from './darken';
3
- export { lighten } from './lighten';
4
- export { contrast } from './contrast';
5
- export { isValid } from './isValid';
6
- export { overlayColors } from './overlayColors';
7
- export { contrastWithAlpha } from './contrastWithAlpha';
8
- export { validateContrast } from './validateContrast';
9
- export { color2hex, colorToHex8, colorToHsva, colorToHsla, colorToRGB } from './conversions';
1
+ export { alpha } from './alpha.js';
2
+ export { darken } from './darken.js';
3
+ export { lighten } from './lighten.js';
4
+ export { contrast } from './contrast.js';
5
+ export { isValid } from './isValid.js';
6
+ export { overlayColors } from './overlayColors.js';
7
+ export { contrastWithAlpha } from './contrastWithAlpha.js';
8
+ export { validateContrast } from './validateContrast.js';
9
+ export { color2hex, colorToHex8, colorToHsva, colorToHsla, colorToRGB } from './conversions.js';
10
10
  declare const _default: {
11
11
  color2hex: (rgb: import("tinycolor2").ColorInputWithoutInstance) => string;
12
12
  colorToHex8: (color: import("tinycolor2").ColorInputWithoutInstance) => string;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAwBA,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAC/B,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AACjC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AACrC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAC/C,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;AACvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AACrD,OAAO,EACL,SAAS,EACT,WAAW,EACX,WAAW,EACX,WAAW,EACX,UAAU,EACX,MAAM,eAAe,CAAA;;;;;;;;AAatB,wBAMC;AAED,YAAY,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAwBA,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAA;AAClC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AACpC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AACtC,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AACxC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AACtC,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAClD,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAA;AAC1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;AACxD,OAAO,EACL,SAAS,EACT,WAAW,EACX,WAAW,EACX,WAAW,EACX,UAAU,EACX,MAAM,kBAAkB,CAAA;;;;;;;;AAazB,wBAMC;AAED,YAAY,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAA"}
package/lib/alpha.js DELETED
@@ -1,45 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports.alpha = alpha;
8
- var _tinycolor = _interopRequireDefault(require("tinycolor2"));
9
- /*
10
- * The MIT License (MIT)
11
- *
12
- * Copyright (c) 2015 - present Instructure, Inc.
13
- *
14
- * Permission is hereby granted, free of charge, to any person obtaining a copy
15
- * of this software and associated documentation files (the "Software"), to deal
16
- * in the Software without restriction, including without limitation the rights
17
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
18
- * copies of the Software, and to permit persons to whom the Software is
19
- * furnished to do so, subject to the following conditions:
20
- *
21
- * The above copyright notice and this permission notice shall be included in all
22
- * copies or substantial portions of the Software.
23
- *
24
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
25
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
26
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
27
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
28
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
29
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
30
- * SOFTWARE.
31
- */
32
-
33
- /**
34
- * ---
35
- * category: utilities/Color
36
- * ---
37
- * Adjust the alpha transparency of a color
38
- * @module alpha
39
- * @param color
40
- * @param percent
41
- * @returns color as rgb string
42
- */
43
- function alpha(color, percent) {
44
- return (0, _tinycolor.default)(color).setAlpha(percent / 100).toRgbString();
45
- }
package/lib/colorTypes.js DELETED
@@ -1,5 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
package/lib/contrast.js DELETED
@@ -1,47 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports.contrast = void 0;
8
- var _tinycolor = _interopRequireDefault(require("tinycolor2"));
9
- /*
10
- * The MIT License (MIT)
11
- *
12
- * Copyright (c) 2015 - present Instructure, Inc.
13
- *
14
- * Permission is hereby granted, free of charge, to any person obtaining a copy
15
- * of this software and associated documentation files (the "Software"), to deal
16
- * in the Software without restriction, including without limitation the rights
17
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
18
- * copies of the Software, and to permit persons to whom the Software is
19
- * furnished to do so, subject to the following conditions:
20
- *
21
- * The above copyright notice and this permission notice shall be included in all
22
- * copies or substantial portions of the Software.
23
- *
24
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
25
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
26
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
27
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
28
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
29
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
30
- * SOFTWARE.
31
- */
32
-
33
- /**
34
- * ---
35
- * category: utilities/Color
36
- * ---
37
- * check the contrast ratio of 2 colors. Optionally number of decimal places can be added
38
- * @module contrast
39
- * @param color1
40
- * @param color2
41
- * @param decimalPlaces
42
- * @returns color contrast ratio
43
- */
44
- const contrast = (color1, color2, decimalPlaces = -1) => {
45
- return decimalPlaces >= 0 ? Math.round(_tinycolor.default.readability(color1, color2) * 10 ** decimalPlaces) / 10 ** decimalPlaces : _tinycolor.default.readability(color1, color2);
46
- };
47
- exports.contrast = contrast;
@@ -1,57 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.contrastWithAlpha = void 0;
7
- var _conversions = require("./conversions");
8
- var _overlayColors = require("./overlayColors");
9
- var _contrast = require("./contrast");
10
- /*
11
- * The MIT License (MIT)
12
- *
13
- * Copyright (c) 2015 - present Instructure, Inc.
14
- *
15
- * Permission is hereby granted, free of charge, to any person obtaining a copy
16
- * of this software and associated documentation files (the "Software"), to deal
17
- * in the Software without restriction, including without limitation the rights
18
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
19
- * copies of the Software, and to permit persons to whom the Software is
20
- * furnished to do so, subject to the following conditions:
21
- *
22
- * The above copyright notice and this permission notice shall be included in all
23
- * copies or substantial portions of the Software.
24
- *
25
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
26
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
27
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
28
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
29
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
30
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
31
- * SOFTWARE.
32
- */
33
-
34
- /**
35
- * ---
36
- * category: utilities/Color
37
- * ---
38
- * Calculates two, not necessarily opaque color's contrast on top of each other.
39
- * The method assumes that the bottom color is on top of a white background (only important if it isn't opaque)
40
- * @module contrastWithAlpha
41
- * @param color1
42
- * @param color2
43
- * @returns color contrast ratio
44
- */
45
- const contrastWithAlpha = (color1, color2) => {
46
- const c1RGBA = (0, _conversions.colorToRGB)(color1);
47
- const c2RGBA = (0, _conversions.colorToRGB)(color2);
48
- const c1OnWhite = (0, _overlayColors.overlayColors)({
49
- r: 255,
50
- g: 255,
51
- b: 255,
52
- a: 1
53
- }, c1RGBA);
54
- const c2OnC1OnWhite = (0, _overlayColors.overlayColors)(c1OnWhite, c2RGBA);
55
- return (0, _contrast.contrast)((0, _conversions.colorToHex8)(c1OnWhite), (0, _conversions.colorToHex8)(c2OnC1OnWhite), 2);
56
- };
57
- exports.contrastWithAlpha = contrastWithAlpha;
@@ -1,82 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports.colorToRGB = exports.colorToHsva = exports.colorToHsla = exports.colorToHex8 = exports.colorToHex = exports.color2hex = void 0;
8
- var _tinycolor = _interopRequireDefault(require("tinycolor2"));
9
- /*
10
- * The MIT License (MIT)
11
- *
12
- * Copyright (c) 2015 - present Instructure, Inc.
13
- *
14
- * Permission is hereby granted, free of charge, to any person obtaining a copy
15
- * of this software and associated documentation files (the "Software"), to deal
16
- * in the Software without restriction, including without limitation the rights
17
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
18
- * copies of the Software, and to permit persons to whom the Software is
19
- * furnished to do so, subject to the following conditions:
20
- *
21
- * The above copyright notice and this permission notice shall be included in all
22
- * copies or substantial portions of the Software.
23
- *
24
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
25
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
26
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
27
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
28
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
29
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
30
- * SOFTWARE.
31
- */
32
-
33
- /**
34
- * Converts any valid `TinyColor` colors to hex string
35
- * @param rgb a color string
36
- * @returns a hex string like `#FF0000`
37
- */
38
- const colorToHex = rgb => {
39
- return (0, _tinycolor.default)(rgb).toHexString().toUpperCase();
40
- };
41
-
42
- /**
43
- * Transforms any `TinyColor` to 8 length HEX (alpha included)
44
- * @param color representation from `TinyColor`
45
- * @returns An 8 length hex string like `#FF0000FF`
46
- */
47
- exports.color2hex = exports.colorToHex = colorToHex;
48
- const colorToHex8 = color => {
49
- return (0, _tinycolor.default)(color).toHex8String().toUpperCase();
50
- };
51
-
52
- /**
53
- * Transforms any `TinyColor` to RGBA object ( {r:number, g:number, b:number, a:number} )
54
- * also exported as `hexToRgb` for backward compatiblity reasons
55
- * @param color representation from `TinyColor`
56
- * @returns A `TinyColor` RGBA type
57
- */
58
- exports.colorToHex8 = colorToHex8;
59
- const colorToRGB = color => {
60
- return (0, _tinycolor.default)(color).toRgb();
61
- };
62
-
63
- /**
64
- * Transforms any `TinyColor` to HSVA object ( {h:number, s:number, v:number, a:number} )
65
- * @param color representation from `TinyColor`
66
- * @returns A `TinyColor` HSVA type
67
- */
68
- exports.colorToRGB = colorToRGB;
69
- const colorToHsva = color => {
70
- return (0, _tinycolor.default)(color).toHsv();
71
- };
72
-
73
- /**
74
- * Transforms any `TinyColor` to HSLA object ( {h:number, s:number, l:number, a:number} )
75
- * @param color representation from `TinyColor`
76
- * @returns A `TinyColor` HSLA type
77
- */
78
- exports.colorToHsva = colorToHsva;
79
- const colorToHsla = color => {
80
- return (0, _tinycolor.default)(color).toHsl();
81
- };
82
- exports.colorToHsla = colorToHsla;
package/lib/darken.js DELETED
@@ -1,45 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports.darken = darken;
8
- var _tinycolor = _interopRequireDefault(require("tinycolor2"));
9
- /*
10
- * The MIT License (MIT)
11
- *
12
- * Copyright (c) 2015 - present Instructure, Inc.
13
- *
14
- * Permission is hereby granted, free of charge, to any person obtaining a copy
15
- * of this software and associated documentation files (the "Software"), to deal
16
- * in the Software without restriction, including without limitation the rights
17
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
18
- * copies of the Software, and to permit persons to whom the Software is
19
- * furnished to do so, subject to the following conditions:
20
- *
21
- * The above copyright notice and this permission notice shall be included in all
22
- * copies or substantial portions of the Software.
23
- *
24
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
25
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
26
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
27
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
28
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
29
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
30
- * SOFTWARE.
31
- */
32
-
33
- /**
34
- * ---
35
- * category: utilities/Color
36
- * ---
37
- * darken a color
38
- * @module darken
39
- * @param color
40
- * @param percent
41
- * @returns color as rgb string
42
- */
43
- function darken(color, percent) {
44
- return (0, _tinycolor.default)(color).darken(percent).toRgbString();
45
- }
package/lib/index.js DELETED
@@ -1,126 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- Object.defineProperty(exports, "alpha", {
7
- enumerable: true,
8
- get: function () {
9
- return _alpha.alpha;
10
- }
11
- });
12
- Object.defineProperty(exports, "color2hex", {
13
- enumerable: true,
14
- get: function () {
15
- return _conversions.color2hex;
16
- }
17
- });
18
- Object.defineProperty(exports, "colorToHex8", {
19
- enumerable: true,
20
- get: function () {
21
- return _conversions.colorToHex8;
22
- }
23
- });
24
- Object.defineProperty(exports, "colorToHsla", {
25
- enumerable: true,
26
- get: function () {
27
- return _conversions.colorToHsla;
28
- }
29
- });
30
- Object.defineProperty(exports, "colorToHsva", {
31
- enumerable: true,
32
- get: function () {
33
- return _conversions.colorToHsva;
34
- }
35
- });
36
- Object.defineProperty(exports, "colorToRGB", {
37
- enumerable: true,
38
- get: function () {
39
- return _conversions.colorToRGB;
40
- }
41
- });
42
- Object.defineProperty(exports, "contrast", {
43
- enumerable: true,
44
- get: function () {
45
- return _contrast.contrast;
46
- }
47
- });
48
- Object.defineProperty(exports, "contrastWithAlpha", {
49
- enumerable: true,
50
- get: function () {
51
- return _contrastWithAlpha.contrastWithAlpha;
52
- }
53
- });
54
- Object.defineProperty(exports, "darken", {
55
- enumerable: true,
56
- get: function () {
57
- return _darken.darken;
58
- }
59
- });
60
- exports.default = void 0;
61
- Object.defineProperty(exports, "isValid", {
62
- enumerable: true,
63
- get: function () {
64
- return _isValid.isValid;
65
- }
66
- });
67
- Object.defineProperty(exports, "lighten", {
68
- enumerable: true,
69
- get: function () {
70
- return _lighten.lighten;
71
- }
72
- });
73
- Object.defineProperty(exports, "overlayColors", {
74
- enumerable: true,
75
- get: function () {
76
- return _overlayColors.overlayColors;
77
- }
78
- });
79
- Object.defineProperty(exports, "validateContrast", {
80
- enumerable: true,
81
- get: function () {
82
- return _validateContrast.validateContrast;
83
- }
84
- });
85
- var _alpha = require("./alpha");
86
- var _darken = require("./darken");
87
- var _lighten = require("./lighten");
88
- var _contrast = require("./contrast");
89
- var _isValid = require("./isValid");
90
- var _overlayColors = require("./overlayColors");
91
- var _contrastWithAlpha = require("./contrastWithAlpha");
92
- var _validateContrast = require("./validateContrast");
93
- var _conversions = require("./conversions");
94
- /*
95
- * The MIT License (MIT)
96
- *
97
- * Copyright (c) 2015 - present Instructure, Inc.
98
- *
99
- * Permission is hereby granted, free of charge, to any person obtaining a copy
100
- * of this software and associated documentation files (the "Software"), to deal
101
- * in the Software without restriction, including without limitation the rights
102
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
103
- * copies of the Software, and to permit persons to whom the Software is
104
- * furnished to do so, subject to the following conditions:
105
- *
106
- * The above copyright notice and this permission notice shall be included in all
107
- * copies or substantial portions of the Software.
108
- *
109
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
110
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
111
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
112
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
113
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
114
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
115
- * SOFTWARE.
116
- */
117
- // TODO remove when we get rid of babel-plugin-transform-imports
118
- // This default export is needed because babel-plugin-transform-imports will
119
- // fail if the exported name is not the same as the filename
120
- var _default = exports.default = {
121
- color2hex: _conversions.color2hex,
122
- colorToHex8: _conversions.colorToHex8,
123
- colorToHsva: _conversions.colorToHsva,
124
- colorToHsla: _conversions.colorToHsla,
125
- colorToRGB: _conversions.colorToRGB
126
- };
package/lib/lighten.js DELETED
@@ -1,45 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports.lighten = lighten;
8
- var _tinycolor = _interopRequireDefault(require("tinycolor2"));
9
- /*
10
- * The MIT License (MIT)
11
- *
12
- * Copyright (c) 2015 - present Instructure, Inc.
13
- *
14
- * Permission is hereby granted, free of charge, to any person obtaining a copy
15
- * of this software and associated documentation files (the "Software"), to deal
16
- * in the Software without restriction, including without limitation the rights
17
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
18
- * copies of the Software, and to permit persons to whom the Software is
19
- * furnished to do so, subject to the following conditions:
20
- *
21
- * The above copyright notice and this permission notice shall be included in all
22
- * copies or substantial portions of the Software.
23
- *
24
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
25
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
26
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
27
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
28
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
29
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
30
- * SOFTWARE.
31
- */
32
-
33
- /**
34
- * ---
35
- * category: utilities/Color
36
- * ---
37
- * lighten a color
38
- * @module lighten
39
- * @param color
40
- * @param percent
41
- * @returns color as rgb string
42
- */
43
- function lighten(color, percent) {
44
- return (0, _tinycolor.default)(color).lighten(percent).toRgbString();
45
- }
@@ -1,53 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.overlayColors = void 0;
7
- /*
8
- * The MIT License (MIT)
9
- *
10
- * Copyright (c) 2015 - present Instructure, Inc.
11
- *
12
- * Permission is hereby granted, free of charge, to any person obtaining a copy
13
- * of this software and associated documentation files (the "Software"), to deal
14
- * in the Software without restriction, including without limitation the rights
15
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
16
- * copies of the Software, and to permit persons to whom the Software is
17
- * furnished to do so, subject to the following conditions:
18
- *
19
- * The above copyright notice and this permission notice shall be included in all
20
- * copies or substantial portions of the Software.
21
- *
22
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
23
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
24
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
25
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
26
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
27
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
28
- * SOFTWARE.
29
- */
30
-
31
- /**
32
- * ---
33
- * category: utilities/Color
34
- * ---
35
- * Place two RGBA colors on top of each other. The second one (c2) goes on top.
36
- * The method calculates what color would be visible. If the second color (c2) is opaque, the result
37
- * will be c2, if fully transparent, c1. If anything in between, it calculates the real color.
38
- * Alpha is always set to 1 after the calculation
39
- * @module overlayColors
40
- * @param c1
41
- * @param c2
42
- * @returns color as rgb string
43
- */
44
- const overlayColors = (c1, c2) => {
45
- const alpha = 1 - (1 - c1.a) * (1 - c2.a);
46
- return {
47
- r: c2.r * c2.a / alpha + c1.r * c1.a * (1 - c2.a) / alpha,
48
- g: c2.g * c2.a / alpha + c1.g * c1.a * (1 - c2.a) / alpha,
49
- b: c2.b * c2.a / alpha + c1.b * c1.a * (1 - c2.a) / alpha,
50
- a: 1
51
- };
52
- };
53
- exports.overlayColors = overlayColors;
package/lib/package.json DELETED
@@ -1 +0,0 @@
1
- {"type":"commonjs"}
@@ -1,62 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.validateContrast = void 0;
7
- /*
8
- * The MIT License (MIT)
9
- *
10
- * Copyright (c) 2015 - present Instructure, Inc.
11
- *
12
- * Permission is hereby granted, free of charge, to any person obtaining a copy
13
- * of this software and associated documentation files (the "Software"), to deal
14
- * in the Software without restriction, including without limitation the rights
15
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
16
- * copies of the Software, and to permit persons to whom the Software is
17
- * furnished to do so, subject to the following conditions:
18
- *
19
- * The above copyright notice and this permission notice shall be included in all
20
- * copies or substantial portions of the Software.
21
- *
22
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
23
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
24
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
25
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
26
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
27
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
28
- * SOFTWARE.
29
- */
30
-
31
- /**
32
- * ---
33
- * category: utilities/Color
34
- * ---
35
- * Decides if the given contrast is sufficient for different text sizes and situations.
36
- *
37
- * According to WCAG 2.2
38
- *
39
- * AA level (https://www.w3.org/TR/WCAG22/#contrast-minimum)
40
- * - text: 4.5:1
41
- * - large text: 3:1
42
- * - non-text: 3:1 (https://www.w3.org/TR/WCAG22/#non-text-contrast)
43
- *
44
- *
45
- * AAA level (https://www.w3.org/TR/WCAG22/#contrast-enhanced)
46
- * - text: 7:1
47
- * - large text: 4.5:1
48
- * - non-text: 3:1 (https://www.w3.org/TR/WCAG22/#non-text-contrast)
49
- *
50
- * @module validateContrast
51
- * @param contrast
52
- * @param validationLevel WCAG 2.2 validation level
53
- * @returns validation object
54
- */
55
- const validateContrast = (contrast, validationLevel) => {
56
- return {
57
- isValidNormalText: contrast >= (validationLevel === 'AAA' ? 7 : 4.5),
58
- isValidLargeText: contrast >= (validationLevel === 'AAA' ? 4.5 : 3),
59
- isValidGraphicsText: contrast >= 3
60
- };
61
- };
62
- exports.validateContrast = validateContrast;