Closed AlexWarnes closed 2 years ago
Looks really cool. Just a quick thing before I review, we should pass in colors as plain hex strings instead of color objects. Keeps it clean
Oh good to know. I think I was making it more difficult than it needed to be. I'll push an update tomorrow.
Updated color serialization for plain hex strings. New output:
new LayerMaterial({
color: "#fefefe",
name: "Monkey w/ freckles",
layers: [
new Depth({
near: -0.06800000000000028,
far: 5,
origin: [0,0,3],
colorA: "#fe96dc",
colorB: "#68eefb",
}),
new Depth({
near: 1,
far: 3,
origin: [0,0,-1.3670000000000089],
colorA: "#feb600",
colorB: "#000000",
mode: "screen",
}),
new Fresnel({
color: "#fefefe",
power: 1.9099999999999757,
mode: "softlight",
}),
new Noise({
colorA: "#84fee9",
colorB: "#969696",
colorC: "#000000",
colorD: "#000000",
scale: 50,
offset: [0,0,0],
name: "noise",
mode: "lighten",
})
]
})
Great stuff! Thanks!
Adds a button to the debugger to copy the vanilla js code and some util fns to support the serializing.
Let me know what you think!
Examples from the configurator (formatting varies depending on where you paste):
JSX:
Vanilla JS: