Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
private getHexColor (mode: number, color: number, def: string): string {
if (mode === Attributes.CM_RGB) {
const rgb = AttributeData.toColorRGB(color)
return rgb.map(x => x.toString(16).padStart(2, '0')).join('')
}
if (mode === Attributes.CM_P16 || mode === Attributes.CM_P256) {
return this.configService.store.terminal.colorScheme.colors[color]
}
return def
}