IC chip packaged and closed from outside, and no light could transpierce
What do you mean? Do you expect the circuit to be mounted in an opaque enclosure? I think, the discussion is about usual molded IC packages, they have no other light barrier than the black filled package epoxy and they
may be directly light exposed in some applications.
Interestingly, today's small (and thin) SMT packages don't provide sufficient light protection for sensitive analog IC, you can find respective hints in some manufacturers datasheets.
Regarding colour of package material: Only black filled material is absorbing all possibly interfering UV to NIR spectral components.