NOT a good idea.
Have you ever seen a colored barcode? Even one that's a single color other than black?
There is a very important reason all barcodes are black on white. They aren't even black on top of a color most of the time and include a surrounding white background area.
Barcodes need to be read by scanners. By altering the value of the stripes (or the background color) you could very well alter how the code is read entirely.
Every scanner may not be the same... What if one scanner has trouble picking up green and those lines get read as narrower than they are. Or skipped entirely?.. but another scanner overcompensates for green, thickening those lines as it's scanned, changing the product it thinks is being scanned?... it's rife with pitfalls.
It is not wise to set a barcode in anything other than black with a white background.
For some things function is far, far more important than form.
According to comments....
Apparently some colors are okay. Although I wonder if that's more a European aspect as opposed to a US aspect. In the US, I can't ever recall seeing a colored bar code. But perhaps in European/Asian countries it's okay. I honestly don't know about international aspects. All I know is in the US.. use black.