This repository was archived by the owner on Feb 6, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
studio/src/app/components/editor/styles/slide/app-color-chart Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ import {SlideChartType} from '../../../../../models/data/slide';
66
77import { ColorUtils , InitStyleColor } from '../../../../../utils/editor/color.utils' ;
88import { ChartUtils } from '../../../../../utils/editor/chart.utils' ;
9+ import { hexToRgb } from '@deckdeckgo/utils' ;
910
1011enum ApplyColorType {
1112 FILL ,
@@ -52,9 +53,9 @@ export class AppColorDeckSlide {
5253 }
5354
5455 if ( this . applyColorType === ApplyColorType . FILL ) {
55- return ColorUtils . splitColor ( this . selectedElement . style . getPropertyValue ( `--deckgo-chart-fill-color-${ this . colorIndex } ` ) ) ;
56+ return ColorUtils . splitColor ( await this . hexOrRgb ( this . selectedElement . style . getPropertyValue ( `--deckgo-chart-fill-color-${ this . colorIndex } ` ) ) ) ;
5657 } else if ( this . applyColorType === ApplyColorType . STROKE ) {
57- return ColorUtils . splitColor ( this . selectedElement . style . getPropertyValue ( `--deckgo-chart-stroke-${ this . colorIndex } ` ) ) ;
58+ return ColorUtils . splitColor ( await this . hexOrRgb ( this . selectedElement . style . getPropertyValue ( `--deckgo-chart-stroke-${ this . colorIndex } ` ) ) ) ;
5859 } else if ( this . applyColorType === ApplyColorType . AXIS ) {
5960 return ColorUtils . splitColor ( this . selectedElement . style . getPropertyValue ( '--deckgo-chart-axis-color' ) ) ;
6061 } else if ( this . applyColorType === ApplyColorType . GRID ) {
@@ -64,6 +65,11 @@ export class AppColorDeckSlide {
6465 }
6566 } ;
6667
68+ private async hexOrRgb ( color : string ) {
69+ const hexColor : string | undefined = await hexToRgb ( color ) ;
70+ return hexColor ? hexColor : color ;
71+ }
72+
6773 private async toggleColorType ( $event : CustomEvent ) {
6874 if ( ! $event || ! $event . detail ) {
6975 return ;
You can’t perform that action at this time.
0 commit comments