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

  • Home
  • SEARCH
  • 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 9168503
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T15:38:26+00:00 2026-06-17T15:38:26+00:00

I am somewhat confused about the SVG linear gradient specification. Suppose, I want to

  • 0

I am somewhat confused about the SVG linear gradient specification. Suppose, I want to fill a 100×100 rectangle with linear gradient which is slanted at 45 deg. The straightforward way is to specify the gradient points like x1 = 0, y1 = 0, x2 = 100 and y2 =100. But, I am not clear about what happens when I provide points like x1 = 86, y1 = 0, x2 = 100 and y2 = 14. Note, the gradient vector is still parallel to the previous one, but the gradient vector length does not cover the entire bounding box. So, I am having the following doubts:

  1. Are these two gradient definitions equivalent?
  2. In the second case, does svg standard specify about what happens for the points like 100, 100, will it use the extrapolated colors from the gradient vector?
  3. I know svg gradient has an attribute spreadMethod, but according to documentation it plays a role only when gradient starts or ends inside the bounds of the target rectangle. Since the second definition is not the same case (the start and end points lie on bounding box edge), will spreadMethod still play a role here?
  • 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-17T15:38:28+00:00Added an answer on June 17, 2026 at 3:38 pm

    The sentence from the spec: “Indicates what happens if the gradient starts or ends inside the bounds of the target rectangle” merely emphasizes the fact there is no visible effect if the gradient vector’s endpoints lie outside the target rectangle. The gradient and its attributes behave exactly the same no matter where the gradient vector’s endpoints are: inside, outside, or exactly on the bounding box.

    In more detail: There are two gradient attributes that are relevant to this question:

    • The gradient vector determines the “size” of the gradient only if spreadMethod is reflect or repeat. Otherwise, gradient “size” is determined by the bounding box when spreadMethod is pad (the default). Of course, the gradient vector always determines the direction of the gradient.
    • The spreadMethod attribute determines if the gradient repeats and how it repeats (start again with the first stop or the last stop?). If the gradient vector is “padded” to the size of the bounding box there is no need to repeat.

    To answer your questions specifically:

    1. When spreadMethod is pad: yes, they are equivalent; otherwise: no
    2. Yes, as explained above.
    3. Yes, setting spreadMethod to something other than pad will have two effects:

      a. The size of the gradient will shrink from the bounding box to the size of the vector

      b. The gradient will repeat based on the value of the spreadMethod attribute

    Here is a nice illustration of the difference between pad, repeat, and reflect. The line segment represents the gradient vector:

    enter image description here

    from: SVG Essentials/Patterns and Gradients

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

Sidebar

Related Questions

I am somewhat confused about how the group by command works in mysql. Suppose
I'm somewhat confused about using self.navigationItem.rightBarButtonItem and self.navigationController.navigationItem.rightBarButtonItem . Which one is correct way?
I'm somewhat confused about the code below: class BooksTestDrive { public static void main(String
I have spent some time reading the Typescript language specification and am somewhat confused
I'm somewhat confused about the lifecycle of ManagedBeans of type request. In this example
I am somewhat confused about memory allocation of static variable in objective C. should
I'm pretty new to this, so somewhat confused. I want to send OPTIONS converted
I'm somewhat confused about the proper way of calling CreateProcessAsUser with command line parameters.
I am somewhat confused about when things are allocated on the heap (and I
I am somewhat confused about when to use group(), aggregate with $group or mapreduce.

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.