We make so many assumptions about gender expression and identity, and sexual orientation, that it’s sometimes a shock to realize that ideas about them have changed over time. Take pink and blue.

Pink is for girls, blue is for boys—except when it wasn’t. A Ladies’ Home Journal article from 1918 clearly states that “the generally accepted rule is pink for the boys, and blue for the girls. The reason is that pink, being a more decided and stronger color, is more suitable for the boy, while blue, which is more delicate and dainty, is prettier for the girl.”

A decade later, Time magazine repeated the gendered color scheme, this time based on feedback from department stores. It was only during World War Two that gender colors were reassigned.

But it’s not just gender colors that change. Ideas and attitudes about sexual orientation and identity also have a history. Washington State University history professor Peter Boag explores those changes in his intricately woven and meticulously researched book, Same Sex Affairs: Constructing and Controlling Homosexuality in the Pacific Northwest.

Boag says that before the late nineteenth century, people didn’t have identities based on their sexual orientation.

“Prior to that, people were understood to engage in sexual relations, but they didn’t have an identity based on sexual orientation,” he says. While there may have been small “gay” communities in urban areas as early as the eighteenth or even the seventeenth century, the word “gay” wasn’t widely used as a synonym for homosexual until well into the twentieth century (although “gay” was used as slang for penis by the early nineteenth century, an extension of the term “gay blade,” a man-about-town or rake). Indeed, the words “homosexual” and “heterosexual” didn’t appear until the mid-nineteenth century. Both terms were coined by Karl-Maria Kertbeny, a writer and human rights campaigner, who argued that both were natural states of being and thus beyond the purview of law.

But, of course, the laws against non-heterosexual relations existed, and persist in many places to this day. Boag says that such laws in Euro-American cultures were based on Catholic canon: “sodomy” was a religious crime; it became known as “buggery” in English common law. “Though you might be breaking the law,” Boag says, “your affectual activities didn’t define you as a person.”

Up until the 1920s in the Pacific Northwest, males demographically dominated the landscape. Engaged in resource extraction activities—logging, mining, fishing—that were deemed unfit for women, men established relations with other men.

“For working-class men, it didn’t really matter who your sexual partner was,” Boag says. Working-class men didn’t have identities based on their behavior, “as long as you played what was culturally understood as the ‘male role.’ It wasn’t so much what your preference was, or with whom you had intimacies, as it was understood early on that people were, in a sense, pansexual.”

No matter which role male partners took, though, they were still breaking sodomy laws. “But these sodomy laws were broadly written and it wasn’t always exactly clear what sorts of activities they covered,” Boag adds. As class-based sexual practices changed, sodomy laws were revised so that they could be used to unequivocally convict men of loving other men.

Contemporary Americans, subjected to a normalization of sex and gender roles, may have a difficult time accepting that, as recently as 75 years ago, what one did with one’s sexual partners was strongly influenced by class. Middle-class heterosexual relations were often conducted with clothes on, while working-class homosexual partners eschewed kissing.

Working-class men in the Pacific Northwest, Boag says, “developed their own sexual culture. For most of these men, having sex with another male was considered perfectly permissible.” In Same Sex Affairs, Boag writes that “such couplings [went,] for a variety of reasons[,] beyond simply a desire for sex; factors tied to gender, emotion, isolation, and survival also played significant roles.” In other words, as now, people formed relationships for a vast constellation of complex reasons that can never be reduced to sex alone.

Meanwhile, middle-class urban homosexual identities began to emerge in the late nineteenth and early twentieth centuries, and the medical and legal professions began applying those identities to working-class men.

In a process that extended over a period of decades, homosexual identity was imposed on working-class men “from above,” Boag says. “It becomes increasingly problematic for these working-class men to continue to engage in these sexual activities, so they begin adopting ideas of what is not permissible.”

What’s permissible, though, is highly labile. Boag points out a contemporary cultural phenomenon, where men who explicitly identify as heterosexual are having sex with other straight men. University of California Riverside gender and sexuality professor Jane Wards documents the experiences of such men in her 2015 book, Not Gay Sex between Straight White Men; The Cut and Splinter News have both written about the phenomenon and Ward’s book.

“This is the crazy thing about identities and concepts, and how they are applied to people over time,” Boag says. “Is it so anathema to be homosexual that [these contemporary straight males] don’t want to embrace that identity? Is it another way of staying in the closet? Or is it a way to fight against these crazy ideas and concepts that society is trying to place on people? It’s really complicated—so studying it and writing about it is fraught with peril.”

But does this mean that everything we do with another person, or on our own, is a choice? That is one of the cruelest claims made by homophobes who want to “convert” LGBTQ people who have “strayed” from the heterosexual fold.

Boag is reluctant to wade into these waters. There’s a long-term debate, he points out, in history and other disciplines, including queer theory and LGBTQ studies, between “essentialists” and “social constructionists.” Basically, the former says that “there have always been both intrinsic gay and straight identities,” while the constructionists argue that identities are created over time as a historical process.

“We do make choices about who we will have sex with. We make choices about whether we’ll have sex with ourselves. So there’s always that issue, that there is a sort of volition involved,” he says, but adds, that inasmuch as we have a choice about whether to engage in sex or not, “what I am inside and my feelings and my orientation are not a choice.

“To me,” Boag insists, “it is not even an appropriate question to ask. What difference does it make if you are making a choice or not? As long as it is consensual and you’re not harming people.”