Sunday, 6 December 2015

Books and colours

Book I've been reading, Icarus deception by Seth Godin, enjoyed it, about making art is not comfortable and makes us feel vulnerable which is how you know you're making something new. I did like that Icarus could also fly too low.

Article I found interesting, Crash only software.
Sit stand desk, stand desks are normally so expensive but this looks good for the cost, varidesk.
12 years in software development article

Been playing with a Lego picture maker and trying to get rgb values from Lego colours, after doing an average of the rgb values and using the closest average made a lot of thing purple. Delta-E 1976, fast enough with results accurate enough for what I want. My implementation, more info on it.

public static int[] getLegoColourEquiv(int[] rgb) {
        int[] returnColourRGB = {1,1,1};
        if(rgb == null) {
            return returnColourRGB;
        }

        double lowestDelta = Double.MAX_VALUE;
        double deltaE;
        for (int[] colour : colours) {
            //DeltaE76 (CIE 1976)
            deltaE = Math.sqrt(
                    Math.pow(rgb[0] - colour[0], 2) +
                    Math.pow(rgb[1] - colour[1], 2) +
                    Math.pow(rgb[2] - colour[2], 2)
            );
            if(deltaE < lowestDelta) {
                lowestDelta = deltaE;
                returnColourRGB = Arrays.copyOf(colour,

                colour.length);
            }
        }

        return returnColourRGB;
    }

No comments:

Post a Comment