If you cast hypnotic pattern in the dark (assuming the caster has dark vision), does the spell work regardless, or does the target have to be able to actually see (with or without dark vision) for the spell to affect them?
Per the spell description, the target(s) must be able to see the patterns created by the spell. Since the spell creates swirling patterns of color, I would rule that even in complete darkness the target(s) can see it, unless their eyes are closed or otherwise obscured.
My reasoning for this is that swirling patterns of color, on their own, as a magical effect, must be light-based. Though they don't emit light in the sense that a torch does, they must be visible. The spell components here are either a glowing stick of incense or a crystal vial filled with phosphorescent material -- essentially a sparkler or a glowstick. The effect that most people are probably familiar with is that of a glowstick or sparkler leaving trails across your vision in the dark. One might even say these trails create hypnotic patterns.
It might not, because Darkvision robs you of Color vision
While LegendaryDude has an excellent answer, there isn't an inherent assumption that color means light. A red ribbon is still red in the dark.
Therefore, we can't assume that the "pattern of colors" is inherently visible, meaning it provides no illumination. Thus, a creature must see it using Darkvision. All Darkvision robs you of color vision, therefore almost all characters won't see the display.
(As two exceptions, a Warlock with the Devils Sight evocation can see through darkness perfectly, as could a creature with Truesight).
Thus, in darkness creatures with Darkvision or without sight at all are not affected by it.
Though this is a very interpretive answer, and you can come up with counter evidence.