-
-
Notifications
You must be signed in to change notification settings - Fork 89
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The model now supports having SVG gradients applied to individual chunks. A new `gradients` property has been added to the JSON model that contains a map of gradient IDs to definitions. A gradient is applied to a chunk by setting the optional chunk property `gradient` to a gradient ID. Both linear and radial gradients are supported, along with most SVG attributes. Any attribute with a limited set of options is validated to ensure it is set correctly, but the attributes that take lengths or colors simply ensure the value is a string (validating them property would be challenging). Validation has been added to throw an error if any unsupported attributes are present. The "gradient" demo has been updated to use this new gradient support. Now that example sets the gradient on each chunk rather than applying an overlay and masking it to match the model's shape. This greatly simplifies the example. Also the example-specific model files have been moved into the `example` directory. A new model was needed for the updated gradient example, and this seemed like a better place for it to go, so that the top-level of the repository doesn't get too cluttered.
- Loading branch information
Showing
11 changed files
with
2,538 additions
and
256 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.