# What is the color code for no fill?

**URL:** <https://pdfjs.community/t/what-is-the-color-code-for-no-fill/2021>\
**Category:** Technical Support\
**Created:** [September 13, 2022, 4:27pm UTC](https://pdfjs.community/t/what-is-the-color-code-for-no-fill/2021 "2022-09-13T16:27:18Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![shiran305](https://avatars.discourse-cdn.com/v4/letter/s/df705f/32.png) [@shiran305](https://pdfjs.community/u/shiran305)\
**Post date:** [September 13, 2022, 4:27pm UTC](https://pdfjs.community/t/what-is-the-color-code-for-no-fill/2021/1 "2022-09-13T16:27:18Z")

</div>

We’re using a custom header and want to put the option for no fill but don’t know the color code.

this.wvInstance.setColorPalette({  
toolNames: [ToolNames[‘TEXT’], ToolNames[‘FREETEXT’], ToolNames[‘LINE’], ToolNames[‘RECTANGLE’], ToolNames[‘FREEHAND’], ToolNames[‘HIGHLIGHT’]],  
colors: [  
‘#ffffff’,  
‘#FF0000’,  
‘#0000FF’,  
],  
defaults: [{StrokeColor:‘#FF0000’}]  
});

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex031/uploads/pdfjscommunity/original/1X/ffbcd25c7d423db8d5acd5db201c272f4db306dd.png) [@system](https://pdfjs.community/u/system)\
**Post date:** [September 13, 2022, 4:27pm UTC](https://pdfjs.community/t/what-is-the-color-code-for-no-fill/2021/3 "2022-09-13T16:27:24Z")

</div>

**Hello, I’m Ron, an automated tech support bot 🤖**

While you wait for one of our customer support representatives to get back to you, please check out some of these documentation pages:

Guides:
- [Customize toolbar in viewer - Header items - CustomElement](https://pdfjs.express/documentation/ui-customization/customizing-header.8#customelement)
- [Integrating PDF.js Express Viewer into an existing Angular project - Setup](https://pdfjs.express/documentation/get-started-viewer/angular/exist-project#setup)
- [PDF.js Express annotations](https://pdfjs.express/documentation/annotation/overview)

APIs:
- [Core.Tools.RectangularAreaMeasurementTool - getDefaultMeasurementCaptionOptions()](https://pdfjs.express/api/Core.Tools.RectangularAreaMeasurementTool.html#getDefaultMeasurementCaptionOptions__anchor)
- [UndefinedcolorSeparationAdded](https://pdfjs.express/api/namespaces.list.html#event:colorSeparationAdded__anchor)
- [Core.Annotations.WidgetFlags - new WidgetFlags(options)](https://pdfjs.express/api/Core.Annotations.WidgetFlags.html#WidgetFlags__anchor)

Forums:
- [How to change stroke color and fill color at a time](https://pdfjs.community/t/how-to-change-stroke-color-and-fill-color-at-a-time/344/2)
- [Overlapped Annotations doesn’t have measurements in it (getContents() is undefined)](https://pdfjs.community/t/overlapped-annotations-doesnt-have-measurements-in-it-getcontents-is-undefined/253/3)
- [Customize print options](https://pdfjs.community/t/customize-print-options/490/2)

  
  

Share how you are using PDF.js Express in your organization you could win a **$500 Amazon gift card. All participants will receive 6 months of PDF.js Express+ for free**. Learn more [here](https://utm.guru/ueQNw)

---

<div class="post-metadata">

**Author:** ![kkim](https://avatars.discourse-cdn.com/v4/letter/k/3ab097/32.png) [@kkim](https://pdfjs.community/u/kkim)\
**Post date:** [September 13, 2022, 6:36pm UTC](https://pdfjs.community/t/what-is-the-color-code-for-no-fill/2021/4 "2022-09-13T18:36:38Z")

</div>

Hello [shiran305](https://pdfjs.community/u/shiran305),

For the no fill color palette option, you can simply set the opacity to be 0:

 ![image](https://canada1.discourse-cdn.com/flex031/uploads/pdfjscommunity/original/1X/9f7454d005f8df9d5d9c0982837841880f7685aa.jpeg)

```javascript
    instance.setColorPalette({
      toolNames: [ToolNames['TEXT'], ToolNames['FREETEXT'], ToolNames['LINE'], ToolNames['RECTANGLE'], ToolNames['FREEHAND'], ToolNames['HIGHLIGHT']],
      colors: [
      '#ffffff',
      '#FF0000',
      '#0000FF',
      ],
      defaults: [{
        StrokeColor:'#FF0000',
        FillColor: new instance.Core.Annotations.Color(0, 0, 255, 0),
      }]
    });

```

Reference document can be found here:

> **[Create custom annotation styles | Documentation](https://pdfjs.express/documentation/annotation/customizing-default-annotation-styles)**

Best Regards,  
Kevin Kim  
Web Development Support Engineer  
PDFTron Systems, Inc.

Share how you are using PDF.js Express in your organization you could win a **$500 Amazon gift card. All participants will receive 6 months of PDF.js Express+ for free**. Learn more [here](https://utm.guru/ueQNw)

---

<div class="post-metadata">

**Author:** ![shiran305](https://avatars.discourse-cdn.com/v4/letter/s/df705f/32.png) [@shiran305](https://pdfjs.community/u/shiran305)\
**Post date:** [September 13, 2022, 9:18pm UTC](https://pdfjs.community/t/what-is-the-color-code-for-no-fill/2021/5 "2022-09-13T21:18:51Z")

</div>

I should have been more clear. We are using the draw a shape tool, the demo has a no fill option. Putting it to 0% opacity doesn’t make a box.

---

<div class="post-metadata">

**Author:** ![kkim](https://avatars.discourse-cdn.com/v4/letter/k/3ab097/32.png) [@kkim](https://pdfjs.community/u/kkim)\
**Post date:** [September 14, 2022, 2:33pm UTC](https://pdfjs.community/t/what-is-the-color-code-for-no-fill/2021/6 "2022-09-14T14:33:11Z")

</div>

Hello [shiran305](https://pdfjs.community/u/shiran305),

The color code for no-fill is ‘transparency’:

```javascript
      colors: [
      '#ffffff',
      '#FF0000',
      '#0000FF',
      'transparency',
      ],

```

Best Regards,  
Kevin Kim  
Web Development Support Engineer  
PDFTron Systems, Inc.

Share how you are using PDF.js Express in your organization you could win a **$500 Amazon gift card. All participants will receive 6 months of PDF.js Express+ for free**. Learn more [here](https://utm.guru/ueQNw)
