All colors are now color objects

This commit is contained in:
Rezmason
2022-09-28 09:57:42 -07:00
parent 22dd5e8678
commit 3828203876
5 changed files with 58 additions and 46 deletions

View File

@@ -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,

View File

@@ -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,