Skip to content
This repository has been archived by the owner on Feb 10, 2023. It is now read-only.

Commit

Permalink
fix(soba): avoid error when colors length less than stops length in g…
Browse files Browse the repository at this point in the history
…radient texture

* Added args/props support to Gradient Texture story

* Avoid error when colors less than stops.

* remove package-lock from gitignore

Co-authored-by: Chau Tran <nartc7789@gmail.com>
  • Loading branch information
IRobot1 and nartc authored May 7, 2022
1 parent f41eaf9 commit 6cd6abf
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,4 @@ Thumbs.db

# Local Netlify folder
.netlify
/.vs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export class NgtSobaGradientTexture extends NgtCommonTexture {
canvas.width = 16;
canvas.height = size;
const gradient = context.createLinearGradient(0, 0, 0, size);
let i = stops.length;
let i = Math.min(stops.length, colors.length);
while (i--) {
gradient.addColorStop(stops[i], colors[i]);
}
Expand Down

0 comments on commit 6cd6abf

Please sign in to comment.