From f106700cc91d4d01d9e04e8f9528eebcc87f5667 Mon Sep 17 00:00:00 2001 From: Roman Rodionov Date: Tue, 17 Sep 2024 14:21:44 +0200 Subject: [PATCH] #5521 - Sugar color is wrong if loaded from HELM with inline SMILES --- .../application/render/renderers/PhosphateRenderer.ts | 5 +++++ .../src/application/render/renderers/SugarRenderer.ts | 9 +++++++++ 2 files changed, 14 insertions(+) diff --git a/packages/ketcher-core/src/application/render/renderers/PhosphateRenderer.ts b/packages/ketcher-core/src/application/render/renderers/PhosphateRenderer.ts index 9aa71b7086..513a088459 100644 --- a/packages/ketcher-core/src/application/render/renderers/PhosphateRenderer.ts +++ b/packages/ketcher-core/src/application/render/renderers/PhosphateRenderer.ts @@ -3,6 +3,7 @@ import { Phosphate } from 'domain/entities/Phosphate'; import { BaseMonomerRenderer } from 'application/render/renderers/BaseMonomerRenderer'; import { MONOMER_SYMBOLS_IDS } from 'application/render/renderers/constants'; import { KetMonomerClass } from 'application/formatters'; +import { RNA_DNA_NON_MODIFIED_PART } from 'domain/constants/monomers'; const PHOSPHATE_SELECTED_ELEMENT_ID = MONOMER_SYMBOLS_IDS[KetMonomerClass.Phosphate].selected; @@ -20,6 +21,10 @@ export class PhosphateRenderer extends BaseMonomerRenderer { ); } + protected getMonomerColor(theme) { + return theme.monomer.color[RNA_DNA_NON_MODIFIED_PART.PHOSPHATE].regular; + } + protected appendBody( rootElement: Selection, theme, diff --git a/packages/ketcher-core/src/application/render/renderers/SugarRenderer.ts b/packages/ketcher-core/src/application/render/renderers/SugarRenderer.ts index ca1cb2a896..fe51cd1ab7 100644 --- a/packages/ketcher-core/src/application/render/renderers/SugarRenderer.ts +++ b/packages/ketcher-core/src/application/render/renderers/SugarRenderer.ts @@ -3,6 +3,7 @@ import { Sugar } from 'domain/entities/Sugar'; import { BaseMonomerRenderer } from 'application/render/renderers/BaseMonomerRenderer'; import { MONOMER_SYMBOLS_IDS } from 'application/render/renderers/constants'; import { KetMonomerClass } from 'application/formatters'; +import { RNA_DNA_NON_MODIFIED_PART } from 'domain/constants/monomers'; const SUGAR_SELECTED_ELEMENT_ID = MONOMER_SYMBOLS_IDS[KetMonomerClass.Sugar].selected; @@ -21,6 +22,14 @@ export class SugarRenderer extends BaseMonomerRenderer { ); } + public get textColor() { + return '#fff'; + } + + protected getMonomerColor(theme) { + return theme.monomer.color[RNA_DNA_NON_MODIFIED_PART.SUGAR_RNA].regular; + } + protected appendBody( rootElement: Selection, theme,