@magic-xpa/angular 4.801.0-dev481.310 → 4.801.0-dev481.313

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.
@@ -2275,28 +2275,31 @@ class MagicColorService {
2275
2275
  getColor(colorIndex, colorType) {
2276
2276
  if (!this.colorsData)
2277
2277
  this.getColorData();
2278
- if (this.colorsData && this.colorsData[colorIndex - 1]) {
2279
- let hex = '';
2280
- const grayHashCode = '00808080';
2281
- let color = this.colorsData[colorIndex].split(',');
2282
- if (+color[3] <= 1) {
2283
- switch (colorType) {
2284
- case MAGIC_FG_COLOR:
2285
- hex = (color[1]);
2286
- break;
2287
- case MAGIC_BG_COLOR:
2288
- hex = (color[2]);
2289
- break;
2290
- default:
2291
- console.log('Please enter valid color type : 1-FG, 2-BG ' + colorIndex);
2292
- return '';
2278
+ if (this.colorsData) {
2279
+ if (this.colorsData[colorIndex - 1]) {
2280
+ let hex = '';
2281
+ const grayHashCode = '00808080';
2282
+ let color = this.colorsData[colorIndex - 1].split(',');
2283
+ if (+color[3] <= 1) {
2284
+ switch (colorType) {
2285
+ case MAGIC_FG_COLOR:
2286
+ hex = (color[1]);
2287
+ break;
2288
+ case MAGIC_BG_COLOR:
2289
+ hex = (color[2]);
2290
+ break;
2291
+ default:
2292
+ console.log('Please enter valid color type : 1-FG, 2-BG ' + colorIndex);
2293
+ return '';
2294
+ }
2293
2295
  }
2296
+ else
2297
+ hex = grayHashCode;
2298
+ return this.hexToRgba('#' + hex);
2294
2299
  }
2295
2300
  else
2296
- hex = grayHashCode;
2297
- return this.hexToRgba('#' + hex);
2301
+ console.log('Could not get color for number ' + colorIndex);
2298
2302
  }
2299
- console.log('Could not get color for number ' + colorIndex);
2300
2303
  return '';
2301
2304
  }
2302
2305
  }