It's never safe to assume an o-ring is a certain type, material or hardness based on color alone.
That said there are standard stock colors (you can get o-rings in any color you want from the manufacturer).
Black — Viton (Fluorocarbon), Nitrile (Buna-N)
Blue — Fluorosilicone
Brown —Viton
O-rings made of Viton are typically color-coded as black. Green is the color of choice in Europe for color coding Viton, whereas brown is the color in the US. Black is the normal color to be used and in fact offers the optimum performance.
I have never seen a green o-ring that was not Viton. Viton is often available in black (for better UV resistance) so green is usually a telling sign, but black doesn’t mean it is not Viton.
Ref: Parker O-Ring Handbook
They list several types of materials, two of which are Viton (Fluorocarbon), and Buna-N (Nitrile rubber). In this engineering manual, they list hundreds of liquid compounds and their compatibility with each material for the O-ring, graded on a 1-4 scale
1-Satisfactory
2-Fair (Usually OK for static seal)
3-Doubtful (Sometimes OK for static seal)
4-Unsatisfactory
Both Nitrile and Fluorocarbon get a "1" for gasoline, but both also only get a "3" for Ethanol. In other words based on this grading scale they both work equally well (or poorly) in this application looking strictly at chemical compatibility.
Unfortunately gasoline and ethanol are mutually exclusive for most compounds. What gets a high score for one type gives a "4" for the other.
There is one compound though that gets a "1" for both — Fluorosilicone