---
description: Verify if the function input is a valid hex color
---

# #️⃣ isValidHexColor

{% code title="validateHexColor.js" %}
```javascript
import { isValidHexColor } from 'the-simplifier'

let verifyHex = () => {
    let color = '#foo'
    
    if(!isValidHexColor(color)) {
        return console.log('Invalid hex provided')
    } else {
        return console.log('Valid hex provided')
    }
}

verifyHex() // Expected: Invalid hex provided
```
{% endcode %}

{% hint style="warning" %}
&#x20;The color provided must be a string and started with "#"
{% endhint %}

