Prime Numbers For Web DesignersApril 7, 2011 9:18 AM   Subscribe

They don't really need primes, they just need numbers that are relatively prime to one another.
posted by Wolfdog at 9:23 AM on April 7, 2011 [2 favorites]

Finally, a way to keep my background images from being eaten by locusts!
posted by DU at 9:29 AM on April 7, 2011 [13 favorites]

An example of what we call too clever by half.
posted by orthogonality at 9:31 AM on April 7, 2011

That is actually a really great technique. Thanks veedubya!
posted by Mister_A at 9:32 AM on April 7, 2011

Interesting. TBH I think most of the time a designer is going to notice that their background repeats far more than the actual user, since the user is focused on the things on the background rather than the background, but on theother hand i can still see some neat uses for this.
posted by Artw at 9:38 AM on April 7, 2011

Is a ruffle unit metric?
posted by howling fantods at 9:43 AM on April 7, 2011

Essentially the same insight dictates that meshing gears have relatively prime numbers of teeth.

Guess you could do the same with bike chains, chain rings, and freewheel cogs, but I don't think anyone bothers.
posted by jamjam at 9:45 AM on April 7, 2011

Gah! 1 is not a prime number! Do you know how important that is? It is critical to the Fundamental Theorem of Arithmetic.
posted by ryanrs at 9:46 AM on April 7, 2011 [2 favorites]

They don't really need primes, they just need numbers that are relatively prime to one another.

On the other hand, choosing well-known primes means you don't have to do any of the calculation involved in verifying or generating a set of relative primes (however easy), and primes are plentiful enough in the range designers are likely to be working in that they're not going to want for choices.
posted by weston at 9:48 AM on April 7, 2011

I never knew you could stack multiple images in one background-image:{}. Is that well supported?
posted by joelf at 9:48 AM on April 7, 2011

joelf... mozilla, webkit, and IE 9.
posted by weston at 9:51 AM on April 7, 2011

Sure, weston, but I would never get anything published if I didn't constantly hone my skills at making wafer-thin generalizations of existing results by people with actual ideas.
posted by Wolfdog at 9:53 AM on April 7, 2011 [4 favorites]

If you like this technique, Wang tiles will blow your mind.
posted by demiurge at 10:00 AM on April 7, 2011 [6 favorites]

Wolfdog, at least you're trying. I found the whole prospect so intimidating I didn't even get to grad school. :)
posted by weston at 10:01 AM on April 7, 2011

joelf: "I never knew you could stack multiple images in one background-image:{}. Is that well supported"

New to me as well.
posted by brundlefly at 10:08 AM on April 7, 2011

The guy references terraforming and cicadas... is just me, or this a little too Bruce Sterling for it to be a coincidence?
posted by helmutdog at 10:29 AM on April 7, 2011

Gah! 1 is not a prime number! Do you know how important that is? It is critical to the Fundamental Theorem of Arithmetic.

Not only that, but within any ring the elements are partitioned into zero-divisors, units, primes, and composites. (I think that's right... It's been too long since I've studied algebra.) You can't have 1 be both a unit and a prime. Units have very different properties from primes.

I've actually never really liked the FTA explanation for 1 not being prime, because it seems too artificial. I've seen similar explanations for why Π ∅ = 1, but really the simple answer is that the empty product is the multiplicative identity just like the empty sum is the additive identity.
posted by kmz at 10:30 AM on April 7, 2011

Multiple background images are new to CSS3 and not all browsers support this feature, unfortunately.

I first saw it in CSS3 For Web Designers, which includes a pointer to my favorite single-answer-to-a-question site ever: dowebsitesneedtobeexperiencedexactlythesameineverybrowser.com.
posted by fifteen schnitzengruben is my limit at 10:33 AM on April 7, 2011 [8 favorites]

You could probably try to get away with multiple background images by using layers with different z-indexes. I haven't tried it.
posted by adipocere at 10:40 AM on April 7, 2011

That sort of thing can start getting ugly fast, though.
posted by Artw at 10:47 AM on April 7, 2011

This one example is pretty to get away with if the multiple images don't work, you should still get one of the backgrounds. I'm thinking for backgrounds and rounded corners, or shadows, that would be a great technique if it were better supported.
posted by joelf at 10:48 AM on April 7, 2011

Wow. This was way better than I expected it to be -- thanks for sharing!

Most web design articles are spammy bits of dreck, and it's really nice to see ones that *ahem* break the pattern.
posted by schmod at 10:51 AM on April 7, 2011

I'm pretty sure rounded corners & shadows are supported at about the same level as multiple backgrounds, ie: Webkit, Firefox, Opera, IE9. (sometimes with annoying vendor prefix stuff.)
posted by epersonae at 10:54 AM on April 7, 2011

That sort of thing can start getting ugly fast, though.

Thus, the Cicada Principle: really loud and annoying.
posted by Hoopo at 11:05 AM on April 7, 2011

I don't even like to use rounded corners often because of fucking IE8 (and IE7 still has some market share). I hope I remember this exists in two years.
posted by Mayor Curley at 11:18 AM on April 7, 2011

Mayor Curley - Have you looked into CSS3Pie?
posted by Artw at 11:28 AM on April 7, 2011 [1 favorite]

dowebsitesneedtobeexperiencedexactlythesameineverybrowser.com

Yeah, that won't get very far with my clients.
posted by OverlappingElvis at 11:32 AM on April 7, 2011 [3 favorites]

I've actually never really liked the FTA explanation for 1 not being prime, because it seems too artificial.

Yeah, but only mathematicians know abstract algebra. Nobody else knows what a ring is and linking to the wikipedia page really isn't going to help them.
posted by ryanrs at 11:36 AM on April 7, 2011

...of course most people don't know The Fundamental Theorem of Artihmetic, either. But the name makes it sound like they should, so they usually keep their mouths shut and pretend to understand.
posted by ryanrs at 11:41 AM on April 7, 2011

This is why I'll never make a successful tech-oriented blogger. I would have titled it something like "Maximizing psuedo-non-periodic background tiling via css3 background image overlap with prime numbers."
posted by treepour at 11:57 AM on April 7, 2011 [5 favorites]

Neat, thanks.
posted by Gator at 12:30 PM on April 7, 2011

This is why I'll never make a successful tech-oriented blogger. I would have titled it something like "Maximizing psuedo-non-periodic background tiling via css3 background image overlap with prime numbers."

Pony request: need to be able to press '+' more than once...
posted by sodium lights the horizon at 12:56 PM on April 7, 2011

That sort of thing can start getting ugly fast, though.

Seconding that. When I first started doing this stuff I tried it out. It's really not worth the hassle.
posted by thsmchnekllsfascists at 1:14 PM on April 7, 2011

I love 17-year cicadas. I really, really love them. The summer when I was 7 was the BEST SUMMER EVER, and I anxiously awaited 24. Now I plan a pilgrimage back to my hometown in the midwest the summer I am 41. Because oh, man, do I ever love cicadas.

That's all. Back to the Useful Internet Stuff now.
posted by Because at 1:24 PM on April 7, 2011

Yup. This is cool. Totally gonna do this.
posted by killtheliterate at 1:27 PM on April 7, 2011

Finally, another application for prime numbers besides cryptography and establishing communication with advanced alien civilizations!
posted by RobotVoodooPower at 1:46 PM on April 7, 2011

Wang tiles will blow your mind.

I'll pass, the S.O. says she likes the original carpet.
posted by Inspector.Gadget at 4:22 PM on April 7, 2011

jamjam: Guess you could do the same with bike chains, chain rings, and freewheel cogs, but I don't think anyone bothers.

The one place you see that happening is when computing the number of skid patches for a fixed-gear bicycle. Assuming that the typical rider skids with his cranks in one or two primary positions, the number of possible locations that the wheel can be in depends on the largest common denominator between the cog and cranks. Relatively prime combinations will give you the most possible orientations; equal to the number of teeth on the cog.
posted by lantius at 4:54 PM on April 7, 2011 [1 favorite]

« Older Dear Woman   |   PJ Shrugs Newer »