Import
import { NuiColorPicker, nuiParseColor } from '@needless-ui/angular/color-picker';NuiColorPicker
Ein Farbwähler in OKLCH.
| Name | Typ | Standardwert | Beschreibung |
|---|---|---|---|
valueTwo-Way | string | '' | Die Farbe, im gewählten Format geschrieben. Leer, bis eine gewählt ist. |
formatTwo-Way | 'hex' | 'rgb' | 'hsl' | 'oklch' | 'p3' | 'hex' | Wie der Wert geschrieben wird. |
formatsInput | NuiColorFormat[] | hex, rgb, hsl, oklch | Die Formate, die der Format-Button durchläuft. |
gamutInput | 'srgb' | 'p3' | 'srgb' | Die Farben, die die Fläche enthält: sRGB oder Display P3. |
alphaInput | boolean | true | Zeigt den Schieberegler für die Deckkraft. |
swatchesInput | NuiColorSwatch[] | [] | Farben zur Auswahl, mit Namen. |
contrastWithInput | string | Ein Hintergrund, gegen den der Kontrast geprüft wird. | |
eyeDropperInput | boolean | true | Zeigt die Pipette, wo der Browser eine hat. |
disabledInput | boolean | false | Lässt sich nicht ändern. |
labelsInput | Partial<NuiColorPickerLabels> | Alle Texte, die der Farbwähler ansagt, zum Übersetzen. | |
colorEigenschaft | Signal<NuiColor> | Die gewählte Farbe, in OKLCH. |
Helpers
Funktionen für Farben.
| Name | Typ | Standardwert | Beschreibung |
|---|---|---|---|
nuiParseColorMethode | (text: string) => NuiColor | null | Liest eine Farbe in jeder CSS-Syntax. | |
nuiFormatColorMethode | (color, format?) => string | Schreibt eine Farbe in einem Format. | |
nuiToGamutMethode | (color, gamut?: 'srgb' | 'p3') => NuiColor | Bildet eine Farbe wie CSS in sRGB oder Display P3 ab. | |
nuiContrastMethode | (color, background) => number | Das Kontrastverhältnis einer Farbe auf einem Hintergrund, nach WCAG 2. |