ngx-color icon indicating copy to clipboard operation
ngx-color copied to clipboard

Allow color to be undefined on init

Open SvenSeemann opened this issue 3 years ago • 0 comments

It would be nice to allow the color to be undefined on init.

Current behaviour when color input is undefined:

Cannot read property 'hex' of undefined
at toState (color.ts:28)

This could be achieved by adding a check before processing color input here https://github.com/scttcper/ngx-color/blob/e84c0f15a96cc1b2423e75a12c5d99ade8a0eea9/src/lib/common/color-wrap.component.ts#L58

Small example: https://stackblitz.com/edit/angular-wc1bod

Give me short feedback if this would be a possible solution and I'm happy to provide a PR.

SvenSeemann avatar Apr 06 '21 15:04 SvenSeemann