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

[Request] ColorMatrix for Filters #7

Open
summers314 opened this issue Oct 25, 2015 · 0 comments
Open

[Request] ColorMatrix for Filters #7

summers314 opened this issue Oct 25, 2015 · 0 comments

Comments

@summers314
Copy link

Hi, Im trying to make a similar library for Android. It accepts ColorMatrix of 5x4 size , but the filters & effects here are not of that format. Could you convert them to 5x4 or explain how to?

5x4 :
[ a, b, c, d, e,
f, g, h, i, j,
k, l, m, n, o,
p, q, r, s, t ]

When applied to a color [R, G, B, A], the resulting color is computed as:

R’ = a_R + b_G + c_B + d_A + e;
G’ = f_R + g_G + h_B + i_A + j;
B’ = k_R + l_G + m_B + n_A + o;
A’ = p_R + q_G + r_B + s_A + t;

That resulting color [R’, G’, B’, A’] then has each channel clamped to the 0 to 255 range.

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