Comments (8)
Yes, that makes sense now, thank you! We should add something like that to the draft spec.
from colr-gradients-spec.
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.
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
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.
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 is this something you can take?
Yes, I'll work on this.
from colr-gradients-spec.
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.
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.
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)
- use ColorIndex or VarColorIndex in VarColorStop? HOT 2
- Update DeltaSetIndexMap to beyond 16bit HOT 12
- Support static bbox?
- PaintRotate range concerns HOT 3
- figures have old struct names with "V1" HOT 1
- Distinguish ItemVariationStore formats (add format 1) due to change to wordDeltaCount field HOT 12
- Saturation requires unwanted overhead HOT 8
- Make DeltaSetIndexMap consistent x-spec HOT 3
- Clipbox was built futureproof, make it future friendly HOT 3
- CPAL can't reference foreground color HOT 2
- CPAL variation HOT 9
- Pseudocode for vectorization? HOT 3
- Partial contour reference
- (deleted) HOT 1
- Thoughts on blending HOT 7
- Clarifications for Sweep gradients needed HOT 7
- Support compositing-2, esp plus-lighter HOT 2
- COLRv1 capabilities vs. SVG 1.1
- Radial gradients and negative radii with variations or non-normal color stops HOT 74
- Optimize PAINT_COMPOSITE painting algorithm HOT 17
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from colr-gradients-spec.