public static float brightness(Color color) {
        return (float) (Math.sqrt(0.299f * Math.pow(color.r, 2) + 0.587 * Math.pow(color.g, 2) + 0.114 * Math.pow(color.b, 2)));
    }
Does not dispose pixmap.
@param pixmap
@param ninePatch
@return
core/src/com/ray3k/skincomposer/utils/Utils.java