Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: function evaluation in custom formats #27

Open
KhardanOne opened this issue Aug 21, 2023 · 0 comments
Open

Feature Request: function evaluation in custom formats #27

KhardanOne opened this issue Aug 21, 2023 · 0 comments

Comments

@KhardanOne
Copy link

I use ColorPicker in PowerToys as a dev-tool during glsl programming, and loving it! Thank you.

Whenever I try to figure out what is happening inside one of my shaders, I take the values in question, turn them into RGB values, and display them as colored pixels. Then I use ColorPicker and calculate from RGB values backwards to get to the original values. I hope, this makes sense. Here is a common example:

Let's suppose I have a vec3 v; where x, y, z values can go from -1.0 to 1.0. Then I can do something like this:
fragColor = vec4(v * 0.5 + 0.5, 1.0);
As a result, pixels with v(0.0, 0.0, 0.0) values become 50% gray, v(-1.0, -1.0, -1.0) become black, v(1.0, 1.0, 1.0) become white.

After color picking them, I use formulas:

x = color.r * 2.0 - 1.0;
y = color.g * 2.0 - 1.0;
z = color.b * 2.0 - 1.0;

to get back the value of v. This is just an example. I use several other formulas for different kinds of things.

This last step is what I do in head or in a calculator, and would love to automate. The idea is to put these functions inside ColorPicker's custom format field, and have ColorPicker evaluate them. E.g. like this: vec3($(Ref * 2.0 - 1.0), $(Grf * 2.0 - 1.0), $(Blf * 2.0 - 1.0)) or something similar.

This might be quite a non-typical use-case. What do you think, is it worth adding it to ColorPicker?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant