Glass is opaque in your hand and in the inventory but in the hot bar or when placed it is translucent as expected. This is using a custom texture pack.
Coloured glass also goes completely transparent on occasion once placed. This can be fixed by either changing view angle.
Related issues
duplicates
Attachments
Comments

You're using a texture pack. The bug is non-related to vanilla minecraft.

@Steven McQueeen:
Unlrelated to any texturepack - happens in vanilla too. I think this is one of those "not so easy to fix" bugs (transparent items are problematic). Same with ice blocks in the inventory ... if there's already a ticket about non-transparent ice block items resolved as "works as intended", I would do the same for this ticket.
The last part of the issue is a duplicate of MC-31658 (the first part is works-as-intended). Glass is displayed with fully transparency instead of partial transparency because it is below 50%, which is reasonable.
Note that as I said in the comments of that issue, it is a big deal because due to removing backface culling (which can be a GOOD feature on its own, and certainly helps with perception of where the glass is), the texture is actually blended with itself (as you are always looking through 2 faces), meaning it is more opaque than the texture itself, severely limiting how transparent a stained glass texture can be.
OK I understand why it occurs now, thank you for the comments.