Skip to content

Commit 8113cae

Browse files
committed
add binding for nostroke
1 parent 19c41b5 commit 8113cae

File tree

4 files changed

+11
-1
lines changed

4 files changed

+11
-1
lines changed

gleam.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name = "p5js_gleam"
2-
version = "2.0.0"
2+
version = "2.0.1"
33
target = "javascript"
44

55
description = "A simple game library providing p5.js bindings for Gleam in a functional style to make basic games and animations. Heavily inspired by the Racket library 2htdp/universe"

scripts/generate_p5.ts

+1
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ const elements = {
3535
],
3636
fill: ["color_hex: String"],
3737
stroke: ["color_hex: String"],
38+
noStroke: [],
3839
strokeWeight: ["weight: Int"],
3940
};
4041

src/p5js_ffi.mjs

+5
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,11 @@ export function stroke(p, ...args) {
100100
return p;
101101
}
102102

103+
export function noStroke(p, ...args) {
104+
p.noStroke(...args);
105+
return p;
106+
}
107+
103108
export function strokeWeight(p, ...args) {
104109
p.strokeWeight(...args);
105110
return p;

src/p5js_gleam/bindings.gleam

+4
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,10 @@ pub fn fill(p: P5, color_hex: String) -> P5
9090
@external(javascript, "../p5js_ffi.mjs", "stroke")
9191
pub fn stroke(p: P5, color_hex: String) -> P5
9292

93+
/// A binding to the p5.js `noStroke` function. Takes a p5 instance and the function's arguments and returns the p5 instance.
94+
@external(javascript, "../p5js_ffi.mjs", "noStroke")
95+
pub fn no_stroke(p: P5) -> P5
96+
9397
/// A binding to the p5.js `strokeWeight` function. Takes a p5 instance and the function's arguments and returns the p5 instance.
9498
@external(javascript, "../p5js_ffi.mjs", "strokeWeight")
9599
pub fn stroke_weight(p: P5, weight: Int) -> P5

0 commit comments

Comments
 (0)