[CSS disclosure] pseudo-random background

Source: Internet
Author: User

Things in nature do not exist in an infinitely tiled way, and if you want things to create a natural randomness, then you need to use a pseudo-random technique.

When you notice an identifiable feature that repeats itself in a fixed pattern, the natural randomness of its view will collapse immediately.

How to produce a real random stripe, which requires first understanding what is called the maximum common multiple and prime numbers.

If there is a multilayer pattern, and each layer of patterns in accordance with their own mathematical laws in the repetition, then the final overlap produced patterns will be the mathematical pattern of these patterns least common multiple to repeat.

In order to maximize least common multiple, these numbers are best "relative prime" or are prime numbers.

This technique was proposed by Alex Walker, named "Cicada principle".

Application Scenarios:

1. In the picture library, for each picture to make a subtle pseudo-random rotation effect, you can select the specified child element by the prime number to rotate the corresponding angle of a prime number.

2. When you define an animation for an element, you can define multiple animations with different prime numbers.

[CSS disclosure] pseudo-random background

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.