ngx-colors
ngx-colors copied to clipboard
Feature request to only show the color picker
It would be great to provide an option such as:
-
showOnlyPicker="true"
to only show the color picker panel when opening. It would also hide the return button to prevent access to the palette panel.
Use case here is to only provide the color picker to the user.
Edit, here is a workaround:
@Component({
...
})
export class MyComponent {
@ViewChild(NgxColorsTriggerDirective)
ngxColor: NgxColorsTriggerDirective;
// Bind (open) event in template
onColorPickerOpened(): void {
const $panel: PanelComponent = this.ngxColor.panelRef.instance;
$panel.menu = 3;
if ($panel.color.length === 0) {
$panel.color = 'rgb(255, 255, 255)'; // Force a default color and format, optional.
}
}
}