Rezmason / matrix

matrix (web-based green code rain, made with love)
https://rezmason.github.io/matrix
MIT License
3.29k stars 212 forks source link

Colors and intensities of glint and cursor should be separate properties— and colors should stay within their gamuts #39

Closed ptdev closed 1 year ago

ptdev commented 1 year ago

Hi,

First of all, thanks for building such a cool project.

Now, I'm having some trouble figuring out what are the ranges for the RGB colors that we can set for backgroundColor, glintColor and cursorColor.

On most examples, the numbers used are decimals in the 0-1 ranges that's used for stripecolors, pallette, etc.

But then on the default config we have (for example) the following: cursorColor: { space: "rgb", values: [1.5, 2, 0.9] }

So, we have a 1.5 and a 2 value there. What exactly do these represent?

So what are the RGB color ranges for those parameters? Are these 0-1 range? 0-10 range? 0-255 range?

Cheers

Rezmason commented 1 year ago

Thanks for your interest in the project!

You're rightfully confused, this is confusing and I should change it.

These are RGB colors, with zero representing black and one representing white. The reason they're sometimes more than one is because the colors can exist outside RGB space, which helps them be really bright.

That's not supported in the HSL versions of these colors, which is another hint that this is the wrong approach.

I'll change this shortly so that backgroundColor, glintColor and cursorColor are all colors within their color space, and separately, something like glintIntensity and cursorIntensity amplify their brightness.

glintBrightness (and glintContrast) already exist, and factor into the glint in an earlier step of the pipeline, which confuses things. This is what I get for supporting fifty properties in the config. I'll work something out.

In the meantime, just know that these RGB values operate in the zero-is-black, white-is-one range.

ptdev commented 1 year ago

Ah, that is it then.

I assumed it would be 0-1, was just confused about the higher values and had no idea that colors could exist outside of the rgb color space.

But your reply clarified it. And thanks for adding/supporting those 50 config options. :heart: Even when a little confusing, being able to configure this effect greatly enhances it

Cheers and thanks again. 👍 Closing the issue