@tetacom/ng-components 1.0.134 → 1.0.135

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.
@@ -5299,10 +5299,10 @@ class ColorInputComponent {
5299
5299
  onTouched() {
5300
5300
  }
5301
5301
  getHexColor(color) {
5302
- if (color?.startsWith('rgb')) {
5302
+ if (color && color.startsWith('rgb')) {
5303
5303
  const value = color.substring(color.indexOf('(') + 1, color.lastIndexOf(')'));
5304
5304
  const colorArray = value.split(',');
5305
- return `#${parseInt(colorArray[0], 10).toString(16)}${parseInt(colorArray[1], 10).toString(16)}${parseInt(colorArray[2], 10).toString(16)}`;
5305
+ color = `#${('00' + parseInt(colorArray[0], 10).toString(16)).slice(-2)}${('00' + parseInt(colorArray[1], 10).toString(16)).slice(-2)}${('00' + parseInt(colorArray[2], 10).toString(16)).slice(-2)}`;
5306
5306
  }
5307
5307
  return color;
5308
5308
  }