# How to change stroke color and fill color at a time

**URL:** <https://pdfjs.community/t/how-to-change-stroke-color-and-fill-color-at-a-time/344>\
**Category:** Technical Support\
**Created:** [October 19, 2020, 4:16am UTC](https://pdfjs.community/t/how-to-change-stroke-color-and-fill-color-at-a-time/344 "2020-10-19T04:16:38Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![vivek.sonawane](https://avatars.discourse-cdn.com/v4/letter/v/e95f7d/32.png) [@vivek.sonawane](https://pdfjs.community/u/vivek.sonawane)\
**Post date:** [October 19, 2020, 4:16am UTC](https://pdfjs.community/t/how-to-change-stroke-color-and-fill-color-at-a-time/344/1 "2020-10-19T04:16:38Z")

</div>

Let’s say we have a color Red and we are trying to fill area annotation with red color with Opacity 0.5. after doing this fill color with opacity is working fine but opacity is also applied to the border of that annotation.  
is it possible to get any color and fill the annotation with that color and with specific opacity without changing its border opacity?

 ![image](https://canada1.discourse-cdn.com/flex031/uploads/pdfjscommunity/original/1X/f58d84e598aa0e73bd4938dfc9f9cb29b3ea5363.png)  
TIP : border-color must not be same as the filled color.

Thank you,  
Vivek Sonawane

---

<div class="post-metadata">

**Author:** ![Logan](https://yyz1.discourse-cdn.com/flex031/user_avatar/pdfjs.community/logan/32/13_2.png) [@Logan](https://pdfjs.community/u/Logan)\
**Post date:** [October 21, 2020, 4:28pm UTC](https://pdfjs.community/t/how-to-change-stroke-color-and-fill-color-at-a-time/344/2 "2020-10-21T16:28:45Z")

</div>

Hi there,

Having a different opacity for fill and stroke is not supported in the PDF spec, so this is not possible to do.

Thanks!  
Logan
