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

Color wheel code needs refactoring #2

Open
sasha42 opened this issue Feb 21, 2016 · 0 comments
Open

Color wheel code needs refactoring #2

sasha42 opened this issue Feb 21, 2016 · 0 comments

Comments

@sasha42
Copy link
Owner

sasha42 commented Feb 21, 2016

As of 8d54452 the code looks quite ugly, and requires serious refactoring. Things like this:

        // assigning onchange event handler
        cp.onchange = function (clr) {
            var confus;
            var red = (hexToRgb(clr).r);
            var calcr = red*16;
            var green = (hexToRgb(clr).g);
            var calcg = green*16;
            var blue = (hexToRgb(clr).b);
            var calcb = blue*16;
            var obj = {0: calcr, 1: calcg, 2: calcb}
            confus = JSON.stringify(obj);
            console.log(confus)
            ws.send(confus);
            colors = clr;
        };
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