Skip to main content

upp-color

Reusable color picker control for hexadecimal colors. It combines a direct hex input (RRGGBB) with an HSV visual picker (surface + hue slider), and emits normalized values for parent components.

When to Use

  • You need a reusable color picker in forms or widget configuration panels.
  • You want both manual hexadecimal editing and visual HSV interaction.
  • You need a single normalized output contract (Changed) for integration with FormGroup/component state.

Demo

Source Code

<div class="demo-scroll-container">
<upp-scrollable [scrollbar]="'y'">
<div class="demo-content">
<h2>upp-color</h2>
<p class="demo-description">Reusable color picker with manual hex input and visual HSV selector.</p>

<div class="demo-section">
<upp-color
[label]="'Background color'"
[value]="bgColor"
[dataid]="'demo-color-bg'"
(Changed)="OnBackgroundChanged($event)"
></upp-color>
<upp-color
[label]="'Foreground color'"
[value]="fgColor"
[dataid]="'demo-color-fg'"
(Changed)="OnForegroundChanged($event)"
></upp-color>
</div>

<div class="preview-card" [style.background]="BackgroundPreview" [style.color]="ForegroundPreview">
<h3>Live preview</h3>
<p>bg: {{ bgColor }} · fg: {{ fgColor }}</p>
</div>
</div>
</upp-scrollable>
</div>

API Reference

upp-color

Selector: upp-color

Inputs

NameTypeDefaultDescription
labelstring''Label shown next to the color preview.
valuestring | null'#000000'Current color value. Accepts RRGGBB or #RRGGBB; internally normalized.
dataidstring'upp-color-input'uppDataid value passed to the internal hex input for automation selectors.
placeholderstring'RRGGBB'Placeholder text shown in the hex input.

Outputs

NameTypeDescription
ChangedEventEmitter<string>Emits the normalized hex value (without #) when the user edits via input or picker.