Skip to content
This repository has been archived by the owner on Dec 8, 2022. It is now read-only.

Commit

Permalink
sets alpha to 1 if no value passed
Browse files Browse the repository at this point in the history
  • Loading branch information
Blackbaud-JackMcElhinney committed Jun 28, 2018
1 parent 726d12f commit c753260
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
})
export class SkyColorpickerTemplateDrivenDemoComponent {
public model: any = {
favoriteColor: '#00f'
favoriteColor: 'rgb(0, 0, 225)'
};

public swatches = [
Expand Down
2 changes: 1 addition & 1 deletion src/modules/colorpicker/colorpicker.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ export class SkyColorpickerService {
const hue = hsva.hue;
const saturation = hsva.saturation;
const value = hsva.value;
const alpha = hsva.alpha;
const alpha = hsva.alpha || hsva.alpha === 0 ? hsva.alpha : 1;
const i = Math.floor(hue * 6);
const f = hue * 6 - i;
const p = value * (1 - saturation);
Expand Down

0 comments on commit c753260

Please sign in to comment.