Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9222383
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T03:49:31+00:00 2026-06-18T03:49:31+00:00

I created a drop shadow in SVG using SourceAlpha for the shadow, so its

  • 0

I created a drop shadow in SVG using SourceAlpha for the shadow, so its plain black. Using feColorMatrix I reduced the opacity a bit, but still it wasn’t looking as I wanted – I want the color of the shadow to match a specific color value. So I took a more in depth look at feColorMatrix.

Now I don’t use SourceAlpha as source for the shadow, but SourceGraphic. As my vector image is plain white aka rgba(255, 255, 255, 1), I can calculate the color of the shadow like that:

<feColorMatrix in="the-shadow" result="color-out" type="matrix"
                values="0.0157 0      0      0 0
                        0      0.3059 0      0 0 
                        0      0      0.7765 0 0 
                        0      0      0      1 0  "/>

The outcome should be a dark blue shadow aka rgba(4, 78, 198, 1).

Actually this is working and I believe the calculations are all correct, but when creating a shadow with CSS3 using the same color, there is a noticeable difference: The SVG filter seems to render the color a bit too light. Is there any way to fix that?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T03:49:32+00:00Added an answer on June 18, 2026 at 3:49 am

    feColorMatrix like most filters operates in the linearRGB colour space. If you want an sRGB colour, Try setting color-interpolation-filters=”sRGB” as an attribute on the feColorMatrix.

        <svg width="100%" xmlns:xlink="http://www.w3.org/1999/xlink"
        
        viewBox="0 0 640 480" height="100%"
        xmlns="http://www.w3.org/2000/svg">
        
        <filter id="cm">
        
        <feColorMatrix in="SourceGraphic" type="matrix"
                        values="0.0157 0      0      0 0
                                0      0.3059 0      0 0 
                                0      0      0.7765 0 0 
                                0      0      0      1 0  "/>
        
        </filter>
        
        <filter id="cmRGB">
        
        <feColorMatrix color-interpolation-filters="sRGB" in="SourceGraphic" type="matrix"
                        values="0.0157 0      0      0 0
                                0      0.3059 0      0 0 
                                0      0      0.7765 0 0 
                                0      0      0      1 0  "/>
        
        </filter>
        
        <rect width="100%" height="50%" fill="white" filter="url(#cm)"/>
        
        <rect y="50%" width="100%" height="100%" fill="white" filter="url(#cmRGB)"/>
        
        </svg>

    It sure looks different to me on Firefox.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I created drop down list using java. But i am not aware of creating
I have created a drop down menu using JQuery but when I test it
Anyone know if its possible to yet create a css based drop shadow on
I've basically created a drop down menu using <ul> and <li> with <li> items
Is there any drop shadow plugin for jquery? Seems there was but is no
I've created a sample app for adding drop shadow to a UITableView. When you
I need to create a triangle with a drop shadow using simple html and
I wanted to create a drop shadow behind a button for my app, but
I created a application with a drop down arrow, but the size of the
How do i create a drop shadow to add it to a custom drawable

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.