mirror of
https://github.com/Rezmason/matrix.git
synced 2026-04-21 15:29:30 -07:00
All colors are now color objects
This commit is contained in:
@@ -44,7 +44,7 @@ const makePalette = (regl, entries) => {
|
||||
|
||||
return make1DTexture(
|
||||
regl,
|
||||
paletteColors.flat().map((i) => i * 0xff)
|
||||
paletteColors.map((rgb) => [...rgb, 1])
|
||||
);
|
||||
};
|
||||
|
||||
@@ -65,9 +65,9 @@ export default ({ regl, config }, inputs) => {
|
||||
frag: regl.prop("frag"),
|
||||
|
||||
uniforms: {
|
||||
backgroundColor,
|
||||
cursorColor,
|
||||
glintColor,
|
||||
backgroundColor: colorToRGB(backgroundColor),
|
||||
cursorColor: colorToRGB(cursorColor),
|
||||
glintColor: colorToRGB(glintColor),
|
||||
ditherMagnitude,
|
||||
bloomStrength,
|
||||
tex: inputs.primary,
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import colorToRGB from "../colorToRGB.js";
|
||||
import { loadText, make1DTexture, makePassFBO, makePass } from "./utils.js";
|
||||
|
||||
// Multiplies the rendered rain and bloom by a 1D gradient texture
|
||||
@@ -33,9 +34,10 @@ export default ({ regl, config }, inputs) => {
|
||||
|
||||
// Expand and convert stripe colors into 1D texture data
|
||||
const stripeColors = "stripeColors" in config ? config.stripeColors : config.effect === "pride" ? prideStripeColors : transPrideStripeColors;
|
||||
console.log(stripeColors);
|
||||
const stripeTex = make1DTexture(
|
||||
regl,
|
||||
stripeColors.map((rgb) => [...rgb, 1])
|
||||
stripeColors.map((color) => [...colorToRGB(color), 1])
|
||||
);
|
||||
|
||||
const stripePassFrag = loadText("shaders/glsl/stripePass.frag.glsl");
|
||||
@@ -44,9 +46,9 @@ export default ({ regl, config }, inputs) => {
|
||||
frag: regl.prop("frag"),
|
||||
|
||||
uniforms: {
|
||||
backgroundColor,
|
||||
cursorColor,
|
||||
glintColor,
|
||||
backgroundColor: colorToRGB(backgroundColor),
|
||||
cursorColor: colorToRGB(cursorColor),
|
||||
glintColor: colorToRGB(glintColor),
|
||||
ditherMagnitude,
|
||||
bloomStrength,
|
||||
tex: inputs.primary,
|
||||
|
||||
Reference in New Issue
Block a user