@gen3/toolsff 0.10.81 → 0.10.82

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.
@@ -52,9 +52,9 @@ const colorType = [
52
52
  'lightest',
53
53
  'max'
54
54
  ];
55
- const create10ColorPallet = (mainColor)=>{
56
- const darkColors = getColorsList(DEFAULT_NUM_DARK_COLORS, 90, tinycolor('#000000'), 20, tinycolor(mainColor)).map((color)=>color);
57
- const lightColors = getColorsList(DEFAULT_NUM_LIGHT_COLORS, 90, tinycolor('#ffffff'), 20, tinycolor(mainColor)).reverse().map((color)=>color);
55
+ const create10ColorPallet = (mainColor, shiftAmount = 90, saturation = 20)=>{
56
+ const darkColors = getColorsList(DEFAULT_NUM_DARK_COLORS, shiftAmount, tinycolor('#000000'), saturation, tinycolor(mainColor)).map((color)=>color);
57
+ const lightColors = getColorsList(DEFAULT_NUM_LIGHT_COLORS, shiftAmount, tinycolor('#ffffff'), saturation, tinycolor(mainColor)).reverse().map((color)=>color);
58
58
  return {
59
59
  ...lightColors.reduce((obj, c, idx)=>{
60
60
  obj[colorType[9 - idx]] = c.toHexString();
@@ -106,7 +106,7 @@ const utilityContrast = {
106
106
  category4: '#1b1b1b'
107
107
  };
108
108
  const main = ()=>{
109
- const { values: { themeFile, out } } = parseArgs({
109
+ const { values: { themeFile, out, colorShift, colorSaturation } } = parseArgs({
110
110
  options: {
111
111
  themeFile: {
112
112
  type: 'string',
@@ -143,21 +143,29 @@ const main = ()=>{
143
143
  },
144
144
  table: {
145
145
  type: 'string',
146
- short: 'b',
147
146
  default: '#858585'
148
147
  },
149
148
  navigation: {
150
149
  type: 'string',
151
- short: 'b',
152
150
  default: '#eaeaea'
153
151
  },
154
152
  out: {
155
153
  type: 'string',
156
154
  short: 'o',
157
155
  default: '../'
156
+ },
157
+ colorShift: {
158
+ type: 'string',
159
+ default: '90'
160
+ },
161
+ colorSaturation: {
162
+ type: 'string',
163
+ default: '20'
158
164
  }
159
165
  }
160
166
  });
167
+ const shift = Number(colorShift);
168
+ const saturation = Number(colorSaturation);
161
169
  if (!themeFile) {
162
170
  console.log("No theme file found. Please provide a theme file with '-t'.");
163
171
  return;
@@ -171,14 +179,15 @@ const main = ()=>{
171
179
  flag: 'r'
172
180
  });
173
181
  const themeColors = JSON.parse(themeData);
174
- const primaryPallet = create10ColorPallet(themeColors.primary);
175
- const secondaryPallet = create10ColorPallet(themeColors.secondary);
176
- const accentPallet = create10ColorPallet(themeColors.accent);
177
- const accentPalletWarm = create10ColorPallet(themeColors.accentWarm);
178
- const accentPalletCool = create10ColorPallet(themeColors.accentCool);
179
- const basePallet = create10ColorPallet(themeColors.base);
180
- const chartPallet = create10ColorPallet(themeColors.chart);
181
- const tablePallet = create10ColorPallet(themeColors?.table ?? '#ffffff');
182
+ const primaryPallet = create10ColorPallet(themeColors.primary, shift, saturation);
183
+ const secondaryPallet = create10ColorPallet(themeColors.secondary, shift, saturation);
184
+ const accentPallet = create10ColorPallet(themeColors.accent, shift, saturation);
185
+ const accentPalletWarm = create10ColorPallet(themeColors.accentWarm, shift, saturation);
186
+ const accentPalletCool = create10ColorPallet(themeColors.accentCool, shift, saturation);
187
+ const basePallet = create10ColorPallet(themeColors.base, shift, saturation);
188
+ const chartPallet = create10ColorPallet(themeColors.chart, shift, saturation);
189
+ const tablePallet = create10ColorPallet(themeColors?.table ?? '#ffffff', shift, saturation);
190
+ const navigationPallet = create10ColorPallet(themeColors?.navigation ?? '#ffffff', shift, saturation);
182
191
  const theme = {
183
192
  primary: primaryPallet,
184
193
  'primary-contrast': create10ColorAccessibleContrast(primaryPallet),
@@ -197,7 +206,9 @@ const main = ()=>{
197
206
  chart: chartPallet,
198
207
  'chart-contrast': create10ColorAccessibleContrast(chartPallet),
199
208
  table: tablePallet,
200
- 'table-contrast': create10ColorAccessibleContrast(tablePallet)
209
+ 'table-contrast': create10ColorAccessibleContrast(tablePallet),
210
+ navigation: navigationPallet,
211
+ 'navigation-contrast': create10ColorAccessibleContrast(navigationPallet)
201
212
  };
202
213
  writeFileSync(join(out ?? './', 'themeColors.json'), JSON.stringify(theme, null, 2));
203
214
  };
@@ -73,6 +73,7 @@ const processIconSet = async (inpath, prefix)=>{
73
73
  });
74
74
  return iconSet;
75
75
  };
76
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
76
77
  const build = async (inpath, outpath, prefix = 'gen3')=>{
77
78
  // Import icons
78
79
  const subdirs = getSubdirectories(inpath);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gen3/toolsff",
3
- "version": "0.10.81",
3
+ "version": "0.10.82",
4
4
  "description": "tools for processing Gen3 commons content: color theme, icons",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -28,7 +28,8 @@
28
28
  "dependencies": {
29
29
  "@iconify/tools": "^4.1.1",
30
30
  "tinycolor2": "^1.6.0",
31
- "undici": "^6.21.1"
31
+ "undici": "^6.21.1",
32
+ "axios": "^1.8.2"
32
33
  },
33
34
  "devDependencies": {
34
35
  "rollup-plugin-executable": "^1.6.3"
@@ -42,7 +43,8 @@
42
43
  "overrides": {
43
44
  "@iconify/tools": {
44
45
  "cheerio": "^1.0.0-rc.12",
45
- "undici": "^6.21.1"
46
+ "undici": "^6.21.1",
47
+ "axios": "^1.8.2"
46
48
  }
47
49
  }
48
50
  }