import { ChangeDetectionStrategy, Component, computed, inject, } from '@angular/core'; import { toSignal } from '@angular/core/rxjs-interop'; import { ActivatedRoute } from '@angular/router'; import type { PluginMessageEvent, PluginUIEvent, ThemePluginEvent, } from '../model'; import { filter, fromEvent, map, merge, take } from 'rxjs'; import { CommonModule } from '@angular/common'; import { Shape } from '@penpot/plugin-types'; @Component({ imports: [CommonModule], selector: 'app-root', template: `
Select two filled shapes to calculate the color contrast between them.
} @else if (selection().length === 1) {Select one more filled shape to calculate the color contrast between the selected colors.
} @else if (selection().length >= 2) {Selected colors:
Contrast ratio: {{ result() }} : 1
Normal text:
Large text (starting from 19px bold or 24px):
Graphics (such as form input borders):