mirror of
https://github.com/Rezmason/matrix.git
synced 2026-04-14 12:29:30 -07:00
All colors are now color objects
This commit is contained in:
@@ -98,9 +98,9 @@ export default ({ config, device, timeBuffer }) => {
|
||||
configBuffer = makeUniformBuffer(device, configUniforms, {
|
||||
bloomStrength: config.bloomStrength,
|
||||
ditherMagnitude: config.ditherMagnitude,
|
||||
backgroundColor: config.backgroundColor,
|
||||
cursorColor: config.cursorColor,
|
||||
glintColor: config.glintColor,
|
||||
backgroundColor: colorToRGB(config.backgroundColor),
|
||||
cursorColor: colorToRGB(config.cursorColor),
|
||||
glintColor: colorToRGB(config.glintColor),
|
||||
});
|
||||
|
||||
const paletteUniforms = paletteShaderUniforms.Palette;
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import colorToRGB from "../colorToRGB.js";
|
||||
import { structs } from "../../lib/gpu-buffer.js";
|
||||
import { loadShader, make1DTexture, makeUniformBuffer, makeBindGroup, makeComputeTarget, makePass } from "./utils.js";
|
||||
|
||||
@@ -7,22 +8,22 @@ import { loadShader, make1DTexture, makeUniformBuffer, makeBindGroup, makeComput
|
||||
// This shader introduces noise into the renders, to avoid banding
|
||||
|
||||
const transPrideStripeColors = [
|
||||
[0.36, 0.81, 0.98],
|
||||
[0.96, 0.66, 0.72],
|
||||
[1.0, 1.0, 1.0],
|
||||
[0.96, 0.66, 0.72],
|
||||
[0.36, 0.81, 0.98],
|
||||
{ space: "rgb", values: [0.36, 0.81, 0.98] },
|
||||
{ space: "rgb", values: [0.96, 0.66, 0.72] },
|
||||
{ space: "rgb", values: [1.0, 1.0, 1.0] },
|
||||
{ space: "rgb", values: [0.96, 0.66, 0.72] },
|
||||
{ space: "rgb", values: [0.36, 0.81, 0.98] },
|
||||
]
|
||||
.map((color) => Array(3).fill(color))
|
||||
.flat(1);
|
||||
|
||||
const prideStripeColors = [
|
||||
[0.89, 0.01, 0.01],
|
||||
[1.0, 0.55, 0.0],
|
||||
[1.0, 0.93, 0.0],
|
||||
[0.0, 0.5, 0.15],
|
||||
[0.0, 0.3, 1.0],
|
||||
[0.46, 0.03, 0.53],
|
||||
{ space: "rgb", values: [0.89, 0.01, 0.01] },
|
||||
{ space: "rgb", values: [1.0, 0.55, 0.0] },
|
||||
{ space: "rgb", values: [1.0, 0.93, 0.0] },
|
||||
{ space: "rgb", values: [0.0, 0.5, 0.15] },
|
||||
{ space: "rgb", values: [0.0, 0.3, 1.0] },
|
||||
{ space: "rgb", values: [0.46, 0.03, 0.53] },
|
||||
]
|
||||
.map((color) => Array(2).fill(color))
|
||||
.flat(1);
|
||||
@@ -40,7 +41,7 @@ export default ({ config, device, timeBuffer }) => {
|
||||
const stripeColors = "stripeColors" in config ? config.stripeColors : config.effect === "pride" ? prideStripeColors : transPrideStripeColors;
|
||||
const stripeTex = make1DTexture(
|
||||
device,
|
||||
stripeColors.map((rgb) => [...rgb, 1])
|
||||
stripeColors.map((color) => [...colorToRGB(color), 1])
|
||||
);
|
||||
|
||||
const linearSampler = device.createSampler({
|
||||
@@ -72,9 +73,9 @@ export default ({ config, device, timeBuffer }) => {
|
||||
configBuffer = makeUniformBuffer(device, configUniforms, {
|
||||
bloomStrength: config.bloomStrength,
|
||||
ditherMagnitude: config.ditherMagnitude,
|
||||
backgroundColor: config.backgroundColor,
|
||||
cursorColor: config.cursorColor,
|
||||
glintColor: config.glintColor,
|
||||
backgroundColor: colorToRGB(config.backgroundColor),
|
||||
cursorColor: colorToRGB(config.cursorColor),
|
||||
glintColor: colorToRGB(config.glintColor),
|
||||
});
|
||||
})();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user