"CSS" Box-shadow matching PS projection effect/text-shadow

Source: Internet
Author: User
Tags cos sin

Reference Material: http://blog.csdn.net/lpandeng/article/details/72778451

Box-shaow: Distance (X-offset Y-offset) Phantom (Blur-radius) extension (Spread-radius) projection color (RGBA);

Angle (Angle): The angle of the projection.

distance (Distance): The distance of the shadow. The X-offset and Y-offet in the CSS3 shadow can be converted according to the angle and distance.

X-offset = Distance * cos (180-angle),

Y-offset = Distance * sin (180-angle)

Extended (Spread): The extended size of the shadow. Controls how much of the shadow solid color and the bokeh color. Spread * size = the size of the solid color in the shadow. The rest is the color of the blur. CSS3 Shadow Spread-radius = spread * Size

Size: The size of the shadow. In CSS3 Blur-radius + Spread-radius = Size is Blur-radius = Size-spread-radius.

Take the values in the example.

eg

Such as:

X-offset = Distance * cos (180-angle) = 3*cos (180-145) = 4.09px

Y-offset = Distance * sin (180-angle) = 3*sin (180-145) = 2.87px

Blur-radius = Size-spread-radius = 10-spread*size = 10-10*6%= 9.4px

Spread-radius = Spread*size = 10*6% =0.6px

Rgba value (118,113,133,.75)

Then, the corresponding box-shaow:4.09px 2.87px 9.4px 0.6px rgba (118,113,133,0.75)

Similar text-shaow:4.09px 2.87px 9.4px rgba (118,113,133,0.75)

(The difference is that Text-shadow does not have spread-radius so it can't fully achieve the effect in PS)

"CSS" Box-shadow matching PS projection effect/text-shadow

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.