cogentcore / core

A free and open source framework for building powerful, fast, and elegant 2D and 3D apps that run on macOS, Windows, Linux, iOS, Android, and the Web with a single pure Go codebase, allowing you to Code Once, Run Everywhere.
http://cogentcore.org/core
BSD 3-Clause "New" or "Revised" License
1.32k stars 71 forks source link

svg gradient rendering is not working for some cases (fig_cortex_lobes.svg) and colors/gradient tests are failing #843

Closed rcoreilly closed 5 months ago

rcoreilly commented 5 months ago

Describe the bug

in svg/testdata/svg/

How to reproduce

run the test, look at the .png :)

Example code

No response

Relevant output

No response

Platform

macOS

rcoreilly commented 5 months ago

markers are fixed, but gradients are failing at the source: colors/gradient/gradient_test is failing.

also added a very simple radial gradient test to svg test images, which fails.

need to fix this one together.

kkoreilly commented 5 months ago

Guess what you got mad at me for trying to fix yesterday: the failing gradient tests.

rcoreilly commented 5 months ago

gradient transforms are now finally all good: had issues in mat32.Mat2 mul and Inverse. todo: write tests for mat32 Mat2 and Mat3 (suspect it might not be right either).

meanwhile, there is a problem with premultiplied opacity / alpha, as in srn_time_predict or vm_tug_of_war, with opacity in the gradient stops. Kai will fix this one remaining problem, add the explicit gradient tests, and add the code that generates RGB stops from HCT color stops (RGB should always be used behind the scenes).

rcoreilly commented 5 months ago

all good now -- just needed separate opacity values per stop, as in the original rasterx impl, and svg spec.

rcoreilly commented 5 months ago

95d43a9fe7c26de6cd3b7a69dfd661445ecad107