Antibiotics are used primarily for the treatment of bacterial infections. They have no role in the treatment of viral infections.
There have been studies showing that the colour of the phlegm cannot be used to differentiate between viral and bacterial infections in otherwise healthy adults.
That being said, if you have been prescribed a course of antibiotics, it is advisable to complete the entire course of antibiotics, unless you are experiencing side effects from the antibiotics.
This is because stopping the antibiotics prematurely may promote antibiotic resistance in the bacteria, making it harder to treat them in the future.
The presence of blood in the phlegm would warrant a further review by your doctor.