# How to set Color Tolerance when using getColorBoundsRect?

**URL:** <https://forum.kirupa.com/t/how-to-set-color-tolerance-when-using-getcolorboundsrect/293044>\
**Category:** Uncategorized\
**Created:** [July 22, 2009, 12:05pm UTC](https://forum.kirupa.com/t/how-to-set-color-tolerance-when-using-getcolorboundsrect/293044 "2009-07-22T12:05:00Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![lorenz82](https://avatars.discourse-cdn.com/v4/letter/l/df788c/32.png) [@lorenz82](https://forum.kirupa.com/u/lorenz82)\
**Post date:** [July 22, 2009, 12:05pm UTC](https://forum.kirupa.com/t/how-to-set-color-tolerance-when-using-getcolorboundsrect/293044/1 "2009-07-22T12:05:00Z")

</div>

Hi guys, i am trying to detect where the color yellow is inside a BitmapData. It works with this, but…

```php
rect = bmpData.getColorBoundsRect( 0xFFFFFFFF, 0xFFFFFF00 );

```

The problem is that it only finds the exact pixels including the exact color 0xFFFFFF00 (yellow).  
Is there a way to make it have some kind of tolerance?  
So basically it will be able to find even a yellow that is a lil bit darker or ligther?
