# zefoy/ngx-color-picker architecture

> Architecture diagram of the GitHub repository zefoy/ngx-color-picker, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-02). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/zefoy/ngx-color-picker
- Repository: https://github.com/zefoy/ngx-color-picker

## Overview

ngx-color-picker is an Angular color-selection widget exposed through the `colorPicker` directive. A consumer supplies a color and configuration, opens a dialog, edits colors through controls or presets, and receives change, selection, and related events. The directive creates and configures the picker component; the component uses the service for color conversion and coordination, with helper directives and positioning logic supporting interaction. The README documents additional dialog modes, CMYK, alpha/output formats, and buttons. The example app demonstrates usage; unsampled templates and implementation details are represented only where documented.

Main entry points: [`projects/lib/src/lib/color-picker.component.ts`](https://github.com/zefoy/ngx-color-picker/blob/main/projects/lib/src/lib/color-picker.component.ts) (Picker Dialog), [`projects/lib/src/lib/color-picker.service.ts`](https://github.com/zefoy/ngx-color-picker/blob/main/projects/lib/src/lib/color-picker.service.ts) (Color Service), [`projects/app/src/app/app.component.ts`](https://github.com/zefoy/ngx-color-picker/blob/main/projects/app/src/app/app.component.ts) (Example Component), [`projects/lib/src/lib/color-picker.directive.ts`](https://github.com/zefoy/ngx-color-picker/blob/main/projects/lib/src/lib/color-picker.directive.ts) (Picker Directive)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_integration["Angular Integration"]
  node_directive["Picker Directive"]
end

subgraph group_picker["Picker Interface"]
  node_component["Picker Dialog"]
  node_interaction["Input And Slider Helpers<br/>[helpers.ts]"]
end

subgraph group_color["Color Processing"]
  node_service["Color Service"]
  node_formats["Color Formats<br/>[formats.ts]"]
end

subgraph group_example["Example App"]
  node_example["Example Component<br/>[app.component.ts]"]
  node_bootstrap["Example Bootstrap<br/>[main.ts]"]
end

node_consumer(("Angular Consumer"))

node_consumer -->|"uses directive"| node_directive
node_directive -->|"creates and configures"| node_component
node_component -->|"uses conversions"| node_service
node_component -->|"uses controls"| node_interaction
node_component -->|"uses color types"| node_formats
node_service -->|"converts values"| node_formats
node_service -->|"closes active dialog"| node_component
node_bootstrap -->|"bootstraps"| node_example
node_example -->|"demonstrates usage"| node_directive
node_example -->|"calls conversions"| node_service

click node_directive "https://github.com/zefoy/ngx-color-picker/blob/main/projects/lib/src/lib/color-picker.directive.ts"
click node_component "https://github.com/zefoy/ngx-color-picker/blob/main/projects/lib/src/lib/color-picker.component.ts"
click node_interaction "https://github.com/zefoy/ngx-color-picker/blob/main/projects/lib/src/lib/helpers.ts"
click node_service "https://github.com/zefoy/ngx-color-picker/blob/main/projects/lib/src/lib/color-picker.service.ts"
click node_formats "https://github.com/zefoy/ngx-color-picker/blob/main/projects/lib/src/lib/formats.ts"
click node_example "https://github.com/zefoy/ngx-color-picker/blob/main/projects/app/src/app/app.component.ts"
click node_bootstrap "https://github.com/zefoy/ngx-color-picker/blob/main/projects/app/src/main.ts"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_directive toneBlue
class node_component,node_interaction toneAmber
class node_service,node_formats toneMint
class node_example,node_bootstrap toneRose
class node_consumer toneIndigo
```

## Components

### Angular Integration

- [Picker Directive](https://github.com/zefoy/ngx-color-picker/blob/main/projects/lib/src/lib/color-picker.directive.ts): `projects/lib/src/lib/color-picker.directive.ts`

### Picker Interface

- [Picker Dialog](https://github.com/zefoy/ngx-color-picker/blob/main/projects/lib/src/lib/color-picker.component.ts): `projects/lib/src/lib/color-picker.component.ts`
- [Input And Slider Helpers](https://github.com/zefoy/ngx-color-picker/blob/main/projects/lib/src/lib/helpers.ts): `projects/lib/src/lib/helpers.ts`

### Color Processing

- [Color Service](https://github.com/zefoy/ngx-color-picker/blob/main/projects/lib/src/lib/color-picker.service.ts): `projects/lib/src/lib/color-picker.service.ts`
- [Color Formats](https://github.com/zefoy/ngx-color-picker/blob/main/projects/lib/src/lib/formats.ts): `projects/lib/src/lib/formats.ts`

### Example App

- [Example Component](https://github.com/zefoy/ngx-color-picker/blob/main/projects/app/src/app/app.component.ts): `projects/app/src/app/app.component.ts`
- [Example Bootstrap](https://github.com/zefoy/ngx-color-picker/blob/main/projects/app/src/main.ts): `projects/app/src/main.ts`

### Other components

- **Angular Consumer**

## Connections

- Angular Consumer → Picker Directive: uses directive (evidence: `README.md`)
- Picker Directive → Picker Dialog: creates and configures (evidence: `projects/lib/src/lib/color-picker.directive.ts`)
- Picker Dialog → Color Service: uses conversions (evidence: `projects/lib/src/lib/color-picker.component.ts`)
- Picker Dialog → Input And Slider Helpers: uses controls (evidence: `projects/lib/src/lib/color-picker.component.ts`)
- Picker Dialog → Color Formats: uses color types (evidence: `projects/lib/src/lib/color-picker.component.ts`)
- Color Service → Color Formats: converts values (evidence: `projects/lib/src/lib/color-picker.service.ts`)
- Color Service → Picker Dialog: closes active dialog (evidence: `projects/lib/src/lib/color-picker.service.ts`)
- Example Bootstrap → Example Component: bootstraps (evidence: `projects/app/src/main.ts`)
- Example Component → Picker Directive: demonstrates usage (evidence: `projects/app/src/app/app.component.ts`)
- Example Component → Color Service: calls conversions (evidence: `projects/app/src/app/app.component.ts`)
