# Using Constants

**URL:** <https://forums.creativeclouddeveloper.com/t/using-constants/4259>\
**Category:** UXP Plugin API\
**Created:** [February 7, 2022, 9:52am UTC](https://forums.creativeclouddeveloper.com/t/using-constants/4259 "2022-02-07T09:52:28Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![IanBarber](https://avatars.discourse-cdn.com/v4/letter/i/94ad74/32.png) [@IanBarber](https://forums.creativeclouddeveloper.com/u/IanBarber)\
**Post date:** [February 7, 2022, 9:52am UTC](https://forums.creativeclouddeveloper.com/t/using-constants/4259/1 "2022-02-07T09:52:28Z")

</div>

I have started to explore the use of Constants and although there are a couple of posts on here which have helped me, I seem to missing something somewhere.

Scenario:  
I have a document open which is in Gray Gamma 2.2  
Using the code below always returns false when I thought it would be true

What have I done wrong please

```auto
app.activeDocument.mode == constants.ColorModel.GRAYSCALE

```

---

<div class="post-metadata">

**Author:** ![Dominik\_S](https://avatars.discourse-cdn.com/v4/letter/d/ed8c4c/32.png) [@Dominik\_S](https://forums.creativeclouddeveloper.com/u/Dominik_S)\
**Post date:** [February 7, 2022, 8:13pm UTC](https://forums.creativeclouddeveloper.com/t/using-constants/4259/2 "2022-02-07T20:13:53Z")

</div>

I’m currently not in front of PS but I think it needs to be `app.activeDocument.mode == constants.DocumentMode.GRAYSCALE`
