0
Fork 0
mirror of https://github.com/penpot/penpot-plugins.git synced 2025-01-06 14:50:21 -05:00

refactor(contrast-plugin): adapt to type refactor

This commit is contained in:
alonso.torres 2024-09-04 09:14:02 +02:00 committed by Alonso Torres
parent e13bb79dc5
commit 5c82cd335a
2 changed files with 5 additions and 5 deletions

View file

@ -13,7 +13,7 @@ import type {
} from '../model'; } from '../model';
import { filter, fromEvent, map, merge, take } from 'rxjs'; import { filter, fromEvent, map, merge, take } from 'rxjs';
import { CommonModule } from '@angular/common'; import { CommonModule } from '@angular/common';
import { PenpotShape } from '@penpot/plugin-types'; import { Shape } from '@penpot/plugin-types';
@Component({ @Component({
standalone: true, standalone: true,
@ -221,7 +221,7 @@ export class AppComponent {
return [r, g, b]; return [r, g, b];
} }
#getShapeColor(shape?: PenpotShape): string | undefined { #getShapeColor(shape?: Shape): string | undefined {
const fills = shape?.fills; const fills = shape?.fills;
if (fills && fills !== 'mixed') { if (fills && fills !== 'mixed') {
return fills?.[0]?.fillColor ?? shape?.strokes?.[0]?.strokeColor; return fills?.[0]?.fillColor ?? shape?.strokes?.[0]?.strokeColor;

View file

@ -1,4 +1,4 @@
import { PenpotShape } from '@penpot/plugin-types'; import { Shape } from '@penpot/plugin-types';
export interface InitPluginUIEvent { export interface InitPluginUIEvent {
type: 'ready'; type: 'ready';
@ -10,12 +10,12 @@ export interface InitPluginEvent {
type: 'init'; type: 'init';
content: { content: {
theme: string; theme: string;
selection: PenpotShape[]; selection: Shape[];
}; };
} }
export interface SelectionPluginEvent { export interface SelectionPluginEvent {
type: 'selection'; type: 'selection';
content: PenpotShape[]; content: Shape[];
} }
export interface ThemePluginEvent { export interface ThemePluginEvent {