Code Monkey home page Code Monkey logo

Comments (8)

anthrotype avatar anthrotype commented on September 13, 2024 1

Yes, that makes sense now, thank you! We should add something like that to the draft spec.

from colr-gradients-spec.

anthrotype avatar anthrotype commented on September 13, 2024

I'm still trying to figure out what this sentence actually means:

Implementations using the inverse-transform approach noted above can fall back to a linear-gradient combined with a clipping path to achieve proper rendering of problematic affine transforms

from colr-gradients-spec.

behdad avatar behdad commented on September 13, 2024

But of course some matrices are singular or degenerate (with 0 determinant) and cannot be inverted.

The draft spec notes that even these have a "well defined shape", however it is not clear to me what this shape should look like. A visual example could help a lot here.

I'm still trying to figure out what this sentence actually means:

Implementations using the inverse-transform approach noted above can fall back to a linear-gradient combined with a clipping path to achieve proper rendering of problematic affine transforms

This:
image

Top row is where there's no translate, so we have two circles. The middle row is where there's a transformation matrix that is not degenerate (ie. determinant > 0). The last row is the degenerate case where the ellipse collapses into a line. Now since the two ellipses use the same transformation matrix, it follows that the two lines are parallel, which makes the resulting gradient a linear gradient. The shape of the sides can be enforced using clipping. That's what we mean by "fall back to a linear-gradient combined with a clipping path to achieve proper rendering of problematic affine transforms."

[The examples use a repeat mode that stops the rendering at the two sides. I believe we intended to allow different modes but current wording of the step doesn't suggest that.]

Hope that helps.

from colr-gradients-spec.

rsheeter avatar rsheeter commented on September 13, 2024

Per f2f discussion:

Radial gradients
  if both radius are 0 no rendering
    TODO specify this
  if centers are distinct
    if one radius is 0 and one is non-0 we have a triangle
      this is clear from examples
  if centers are the same
    if one radius is 0 and one is non-0 then well defined

  TODO add an example with one circle inside the other

@drott is this something you can take?

from colr-gradients-spec.

drott avatar drott commented on September 13, 2024

@drott is this something you can take?

Yes, I'll work on this.

from colr-gradients-spec.

PeterConstable avatar PeterConstable commented on September 13, 2024

Behdad's comment above illustrated how a linear gradient could result in one case of a degenerate transform. But it doesn't cover all cases: his drawing shows the circles flattened in the same direction as the line from c0 to c1. The result is that the circles are flattened to lines that are perpendicular to the line c0-c1. Of course, the circles could be flattened to lines that aren't perpendicular to c0-c1, and things would still work.

But what if the circles were flattened such that the resulting lines are parallel to c0-c1? (That would be like having (p2-p0) ยท (p1-p0) = 0 for a linear gradient.)

from colr-gradients-spec.

PeterConstable avatar PeterConstable commented on September 13, 2024

Also, if the diameter of the circles in the direction from c0 to c1 is shortened, then so is the distance between c0 and c1.

What was described above considered a situation in which the circles could be transformed without affecting the placement of the circles. But that's not how the current formats work: if a PaintRadialGradient is nested under a PaintTransform, then the radii and the centers are transformed the same way.

from colr-gradients-spec.

PeterConstable avatar PeterConstable commented on September 13, 2024

We made some changes some months ago after discussing transforms that result in degenerate cases for gradients, and there's been no additional discussion in this issue for over six months. So, assuming this can be closed.

from colr-gradients-spec.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.