A black hole is neither a hole nor black.
It's more like a sphere so dense that, in mathematical formulas, it appears as a dimensionless point. Furthermore, we don't know what color it is because light can't bounce off it.
In reality, it is not even true to assert that they attract light, since light cannot be attracted.
The reason is simpler than you might think:
Light always travels in a straight line. If it hits an atom of something, it changes direction but still continues along a straight line.
And this is precisely the point: light must always follow a straight line, even if it is in a region of space "deformed" by the mass of an object. Therefore, the straight line is itself deformed, since space itself is bent.
In the case of a black hole, however, space is so distorted that it tends to close in on itself, so you can enter but not exit, so the line will continue inside the black hole without exiting.