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

multi color brayer matrix for a Coding challange? #1829

Open
Yu-Hayate opened this issue Aug 23, 2024 · 1 comment
Open

multi color brayer matrix for a Coding challange? #1829

Yu-Hayate opened this issue Aug 23, 2024 · 1 comment

Comments

@Yu-Hayate
Copy link

I had this idea because I haven’t found any good Brayer matrix functions that let you work with a custom color array instead of just sticking to the typical R, G, B values that are either 0 or 255. Usually, the threshold is applied like this:

const threshold = ditherMatrix[x % 4][y % 4] / 15;
let newR = r > threshold * 255 ? 255 : 0;
let newG = g > threshold * 255 ? 255 : 0;
let newB = b > threshold * 255 ? 255 : 0;

This limits the colors to either full on or off, but I wanted a way to use more nuanced colors and still get that cool dithered effect, like using a set color array instead.

@Yu-Hayate
Copy link
Author

it seems my coding challenge was 'uninteresting' based on no reply after two weeks, :P

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