Skip to content

Commit

Permalink
Fixed #3376
Browse files Browse the repository at this point in the history
  • Loading branch information
Çağatay Çivici committed Jul 18, 2017
1 parent 7b09c85 commit caa7df2
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/app/components/colorpicker/colorpicker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ export class ColorPicker implements ControlValueAccessor, AfterViewChecked, OnDe
let val: any;
switch(this.format) {
case 'hex':
val = this.HSBtoHEX(this.value);
val = '#' + this.HSBtoHEX(this.value);
break;

case 'rgb':
Expand Down
10 changes: 5 additions & 5 deletions src/app/showcase/components/colorpicker/colorpickerdemo.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@
<h3 class="first">Inline</h3>
<p-colorPicker [(ngModel)]="color1" inline="true"></p-colorPicker>

<p style="margin-top:.5em">Selected Color: <span style="display:inline-block;width:32px;height:32px;vertical-align:middle" [style.backgroundColor]="'#' + color1"></span> {{color1}} </p>
<p style="margin-top:.5em">Selected Color: <span style="display:inline-block;width:32px;height:32px;vertical-align:middle" [style.backgroundColor]="color1"></span> {{color1}} </p>

<h3>Overlay</h3>
<p-colorPicker [(ngModel)]="color2"></p-colorPicker>

<p style="margin-top:.5em">Selected Color: <span [ngStyle]="{'color':'#' + color2}">{{color2}}</span></p>
<p style="margin-top:.5em">Selected Color: <span [ngStyle]="{'color':color2}">{{color2}}</span></p>
</div>

<div class="content-section documentation">
Expand Down Expand Up @@ -248,12 +248,12 @@ <h3>Dependencies</h3>
&lt;h3 class="first"&gt;Inline&lt;/h3&gt;
&lt;p-colorPicker [(ngModel)]="color1" inline="true"&gt;&lt;/p-colorPicker&gt;

&lt;p style="margin-top:.5em"&gt;Selected Color: &lt;span style="display:inline-block;width:32px;height:32px;vertical-align:middle" [style.backgroundColor]="'#' + color1"&gt;&lt;/span&gt; &#123;&#123;color1&#125;&#125; &lt;/p&gt;
&lt;p style="margin-top:.5em"&gt;Selected Color: &lt;span style="display:inline-block;width:32px;height:32px;vertical-align:middle" [style.backgroundColor]="color1"&gt;&lt;/span&gt; &#123;&#123;color1&#125;&#125; &lt;/p&gt;

&lt;h3&gt;Overlay&lt;/h3&gt;
&lt;p-colorPicker [(ngModel)]="color2"&gt;&lt;/p-colorPicker&gt;

&lt;p style="margin-top:.5em"&gt;Selected Color: &lt;span [ngStyle]="&#123;'color':'#' + color2&#125;"&gt;&#123;&#123;color2&#125;&#125;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin-top:.5em"&gt;Selected Color: &lt;span [ngStyle]="&#123;'color':color2&#125;"&gt;&#123;&#123;color2&#125;&#125;&lt;/span&gt;&lt;/p&gt;
</code>
</pre>

Expand All @@ -263,7 +263,7 @@ <h3>Dependencies</h3>

color1: string;

color2: string = '1976D2';
color2: string = '#1976D2';
&#125;
</code>
</pre>
Expand Down
2 changes: 1 addition & 1 deletion src/app/showcase/components/colorpicker/colorpickerdemo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ export class ColorPickerDemo {

color1: string;

color2: string = '1976D2';
color2: string = '#1976D2';
}

0 comments on commit caa7df2

Please sign in to comment.