@deephaven/grid 0.9.4-beta.3 → 0.9.4-plugins.9
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/GridColorUtils.js
CHANGED
|
@@ -9,7 +9,7 @@ import convert from 'color-convert';
|
|
|
9
9
|
*/
|
|
10
10
|
export function darkenForDepth(color, depth) {
|
|
11
11
|
var maxDepth = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 6;
|
|
12
|
-
var lab = convert.hex.lab
|
|
12
|
+
var lab = convert.hex.lab(color);
|
|
13
13
|
lab[0] = Math.max(lab[0] - lab[0] / maxDepth * depth, 0);
|
|
14
14
|
return "#".concat(convert.lab.hex(lab));
|
|
15
15
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/GridColorUtils.ts"],"names":["convert","darkenForDepth","color","depth","maxDepth","lab","hex","
|
|
1
|
+
{"version":3,"sources":["../src/GridColorUtils.ts"],"names":["convert","darkenForDepth","color","depth","maxDepth","lab","hex","Math","max","colorWithAlpha","alpha","r","g","b","rgb"],"mappings":"AAAA,OAAOA,OAAP,MAAoB,eAApB;;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,cAAT,CACLC,KADK,EAELC,KAFK,EAIM;AAAA,MADXC,QACW,uEADA,CACA;AACX,MAAMC,GAAG,GAAGL,OAAO,CAACM,GAAR,CAAYD,GAAZ,CAAgBH,KAAhB,CAAZ;AACAG,EAAAA,GAAG,CAAC,CAAD,CAAH,GAASE,IAAI,CAACC,GAAL,CAASH,GAAG,CAAC,CAAD,CAAH,GAAUA,GAAG,CAAC,CAAD,CAAH,GAASD,QAAV,GAAsBD,KAAxC,EAA+C,CAA/C,CAAT;AACA,oBAAWH,OAAO,CAACK,GAAR,CAAYC,GAAZ,CAAgBD,GAAhB,CAAX;AACD;AAED;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,SAASI,cAAT,CAAwBP,KAAxB,EAAoCQ,KAApC,EAA8D;AACnE,MAAM,CAACC,CAAD,EAAIC,CAAJ,EAAOC,CAAP,IAAYb,OAAO,CAACM,GAAR,CAAYQ,GAAZ,CAAgBZ,KAAhB,CAAlB;AACA,wBAAeS,CAAf,eAAqBC,CAArB,eAA2BC,CAA3B,eAAiCH,KAAjC;AACD;AAED,eAAe;AAAED,EAAAA,cAAF;AAAkBR,EAAAA;AAAlB,CAAf","sourcesContent":["import convert from 'color-convert';\nimport { HEX } from 'color-convert/conversions';\nimport { GridColor } from './GridTheme';\n\n/**\n * Darken the provided colour\n * @param color Color in hex format to convert (with #)\n * @param depth Depth to convert the color to\n * @param maxDepth Maximum depth. Defaults to 6\n * @returns Darkened colour in hex format\n */\nexport function darkenForDepth(\n color: HEX,\n depth: number,\n maxDepth = 6\n): GridColor {\n const lab = convert.hex.lab(color);\n lab[0] = Math.max(lab[0] - (lab[0] / maxDepth) * depth, 0);\n return `#${convert.lab.hex(lab)}`;\n}\n\n/**\n * Convert a hex colour to an rgba with specified alpha\n * @param color Color in hex format to convert (with #)\n * @param alpha Alpha to apply to the color\n * @returns Color with the newly applied alpha in rgba format\n */\nexport function colorWithAlpha(color: HEX, alpha: number): GridColor {\n const [r, g, b] = convert.hex.rgb(color);\n return `rgba(${r}, ${g}, ${b}, ${alpha})`;\n}\n\nexport default { colorWithAlpha, darkenForDepth };\n"],"file":"GridColorUtils.js"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@deephaven/grid",
|
|
3
|
-
"version": "0.9.4-
|
|
3
|
+
"version": "0.9.4-plugins.9+b9ea40a",
|
|
4
4
|
"description": "Deephaven React grid component",
|
|
5
5
|
"author": "Deephaven Data Labs LLC",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"@babel/cli": "^7.16.0",
|
|
36
|
-
"@deephaven/tsconfig": "^0.9.4-
|
|
36
|
+
"@deephaven/tsconfig": "^0.9.4-plugins.9+b9ea40a",
|
|
37
37
|
"@types/lodash.clamp": "^4.0.6",
|
|
38
38
|
"@types/prop-types": "^15.7.3",
|
|
39
39
|
"@types/react": "^17.0.2",
|
|
@@ -59,5 +59,5 @@
|
|
|
59
59
|
"publishConfig": {
|
|
60
60
|
"access": "public"
|
|
61
61
|
},
|
|
62
|
-
"gitHead": "
|
|
62
|
+
"gitHead": "b9ea40ab24f060dc1a201caec2082d76a92752d6"
|
|
63
63
|
}
|