summaryrefslogtreecommitdiff
path: root/pugl.js
diff options
context:
space:
mode:
authorpommicket <pommicket@gmail.com>2023-08-29 15:02:21 -0400
committerpommicket <pommicket@gmail.com>2023-08-29 15:02:21 -0400
commit64c42098c549182d8a260194412fe3a44b5b5889 (patch)
treeb2f8177772b9be3e4fda9e09b3adbe564909d9a2 /pugl.js
parent56f9da96a79b109e0a131fa249ead37553ce8f8b (diff)
more guide
Diffstat (limited to 'pugl.js')
-rw-r--r--pugl.js7
1 files changed, 6 insertions, 1 deletions
diff --git a/pugl.js b/pugl.js
index d10c00d..b182480 100644
--- a/pugl.js
+++ b/pugl.js
@@ -103,6 +103,7 @@ ${type} mix_(${type} a, ${type} b, ${type} x, int c) {
//! .id: prev
//! .description: sample from the previous frame
//! pos.description: position to sample — bottom-left corner is (−1, −1), top-right corner is (1, 1)
+//! pos.default: .pos
//! wrap.name: wrap mode
//! wrap.control: select:clamp|wrap
//! wrap.description: how to deal with the input components if they go outside [−1, 1]
@@ -123,7 +124,8 @@ vec3 last_frame(vec2 pos, int wrap, int samp) {
}
`,
`
-//! .name: Weighted add
+//! .name: Weighted sum
+//! .alt: weighted add
//! .category: math
//! .description: add two numbers or vectors with weights
//! aw.name: a weight
@@ -1328,8 +1330,11 @@ function color_hex_to_float(hex) {
let g;
let b;
let a;
+
hex = hex.trim();
+ if (!hex || hex[0] !== '#') return null;
+
if (hex.length === 7 || hex.length === 9) {
// #rrggbb or #rrggbbaa
r = parseInt(hex.substring(1, 3), 16) / 255;