/** * <p>Returns the HSL (Hue/Saturation/Luminance) equivalent of a given * RGB color. All three HSL components are between 0.0 and 1.0.</p> * * @param r the red component, between 0 and 255 * @param g the green component, between 0 and 255 * @param b the blue component, between 0 and 255 * @return a new array of 3 floats corresponding to the HSL components */ public static float[] RGBtoHSL(int r, int g, int b) { return RGBtoHSL(r, g, b, null); }
/** * <p>Returns the HSL (Hue/Saturation/Luminance) equivalent of a given * RGB color. All three HSL components are between 0.0 and 1.0.</p> * * @param r the red component, between 0 and 255 * @param g the green component, between 0 and 255 * @param b the blue component, between 0 and 255 * @return a new array of 3 floats corresponding to the HSL components */ public static float[] RGBtoHSL(int r, int g, int b) { return RGBtoHSL(r, g, b, null); }
@Override void blend(int[] src, int[] dst, int[] result) { float[] srcHSL = new float[3]; ColorUtilities.RGBtoHSL(src[0], src[1], src[2], srcHSL); float[] dstHSL = new float[3]; ColorUtilities.RGBtoHSL(dst[0], dst[1], dst[2], dstHSL); ColorUtilities.HSLtoRGB(dstHSL[0], dstHSL[1], srcHSL[2], result); result[3] = Math.min(255, src[3] + dst[3] - (src[3] * dst[3]) / 255); } },
@Override void blend(int[] src, int[] dst, int[] result) { float[] srcHSL = new float[3]; ColorUtilities.RGBtoHSL(src[0], src[1], src[2], srcHSL); float[] dstHSL = new float[3]; ColorUtilities.RGBtoHSL(dst[0], dst[1], dst[2], dstHSL); ColorUtilities.HSLtoRGB(dstHSL[0], srcHSL[1], dstHSL[2], result); result[3] = Math.min(255, src[3] + dst[3] - (src[3] * dst[3]) / 255); } },
@Override public void blend(int[] src, int[] dst, int[] result) { float[] srcHSL = new float[3]; ColorUtilities.RGBtoHSL(src[0], src[1], src[2], srcHSL); float[] dstHSL = new float[3]; ColorUtilities.RGBtoHSL(dst[0], dst[1], dst[2], dstHSL); ColorUtilities.HSLtoRGB(dstHSL[0], dstHSL[1], srcHSL[2], result); result[3] = Math.min(255, src[3] + dst[3] - (src[3] * dst[3]) / 255); } };
@Override void blend(int[] src, int[] dst, int[] result) { float[] srcHSL = new float[3]; ColorUtilities.RGBtoHSL(src[0], src[1], src[2], srcHSL); float[] dstHSL = new float[3]; ColorUtilities.RGBtoHSL(dst[0], dst[1], dst[2], dstHSL); ColorUtilities.HSLtoRGB(srcHSL[0], dstHSL[1], dstHSL[2], result); result[3] = Math.min(255, src[3] + dst[3] - (src[3] * dst[3]) / 255); } },
@Override void blend(int[] src, int[] dst, int[] result) { float[] srcHSL = new float[3]; ColorUtilities.RGBtoHSL(src[0], src[1], src[2], srcHSL); float[] dstHSL = new float[3]; ColorUtilities.RGBtoHSL(dst[0], dst[1], dst[2], dstHSL); ColorUtilities.HSLtoRGB(dstHSL[0], dstHSL[1], srcHSL[2], result); result[3] = Math.min(255, src[3] + dst[3] - (src[3] * dst[3]) / 255); } },
@Override void blend(int[] src, int[] dst, int[] result) { float[] srcHSL = new float[3]; ColorUtilities.RGBtoHSL(src[0], src[1], src[2], srcHSL); float[] dstHSL = new float[3]; ColorUtilities.RGBtoHSL(dst[0], dst[1], dst[2], dstHSL); ColorUtilities.HSLtoRGB(dstHSL[0], dstHSL[1], srcHSL[2], result); result[3] = Math.min(255, src[3] + dst[3] - (src[3] * dst[3]) / 255); } },
/** * <p>Returns the HSL (Hue/Saturation/Luminance) equivalent of a given * RGB color. All three HSL components are between 0.0 and 1.0.</p> * * @param color the RGB color to convert * @return a new array of 3 floats corresponding to the HSL components */ public static float[] RGBtoHSL(Color color) { return RGBtoHSL(color.getRed(), color.getGreen(), color.getBlue(), null); }
@Override public void blend(int[] src, int[] dst, int[] result) { float[] srcHSL = new float[3]; ColorUtilities.RGBtoHSL(src[0], src[1], src[2], srcHSL); float[] dstHSL = new float[3]; ColorUtilities.RGBtoHSL(dst[0], dst[1], dst[2], dstHSL); ColorUtilities.HSLtoRGB(dstHSL[0], srcHSL[1], dstHSL[2], result); result[3] = Math.min(255, src[3] + dst[3] - (src[3] * dst[3]) / 255); } };
@Override void blend(int[] src, int[] dst, int[] result) { float[] srcHSL = new float[3]; ColorUtilities.RGBtoHSL(src[0], src[1], src[2], srcHSL); float[] dstHSL = new float[3]; ColorUtilities.RGBtoHSL(dst[0], dst[1], dst[2], dstHSL); ColorUtilities.HSLtoRGB(srcHSL[0], srcHSL[1], dstHSL[2], result); result[3] = Math.min(255, src[3] + dst[3] - (src[3] * dst[3]) / 255); } },
/** * <p>Returns the HSL (Hue/Saturation/Luminance) equivalent of a given * RGB color. All three HSL components are between 0.0 and 1.0.</p> * * @param color the RGB color to convert * @return a new array of 3 floats corresponding to the HSL components */ public static float[] RGBtoHSL(Color color) { return RGBtoHSL(color.getRed(), color.getGreen(), color.getBlue(), null); }
@Override void blend(int[] src, int[] dst, int[] result) { float[] srcHSL = new float[3]; ColorUtilities.RGBtoHSL(src[0], src[1], src[2], srcHSL); float[] dstHSL = new float[3]; ColorUtilities.RGBtoHSL(dst[0], dst[1], dst[2], dstHSL); ColorUtilities.HSLtoRGB(dstHSL[0], srcHSL[1], dstHSL[2], result); result[3] = Math.min(255, src[3] + dst[3] - (src[3] * dst[3]) / 255); } },
@Override void blend(int[] src, int[] dst, int[] result) { float[] srcHSL = new float[3]; ColorUtilities.RGBtoHSL(src[0], src[1], src[2], srcHSL); float[] dstHSL = new float[3]; ColorUtilities.RGBtoHSL(dst[0], dst[1], dst[2], dstHSL); ColorUtilities.HSLtoRGB(srcHSL[0], dstHSL[1], dstHSL[2], result); result[3] = Math.min(255, src[3] + dst[3] - (src[3] * dst[3]) / 255); } },
@Override public void blend(int[] src, int[] dst, int[] result) { float[] srcHSL = new float[3]; ColorUtilities.RGBtoHSL(src[0], src[1], src[2], srcHSL); float[] dstHSL = new float[3]; ColorUtilities.RGBtoHSL(dst[0], dst[1], dst[2], dstHSL); ColorUtilities.HSLtoRGB(srcHSL[0], srcHSL[1], dstHSL[2], result); result[3] = Math.min(255, src[3] + dst[3] - (src[3] * dst[3]) / 255); } };
@Override public void blend(int[] src, int[] dst, int[] result) { float[] srcHSL = new float[3]; ColorUtilities.RGBtoHSL(src[0], src[1], src[2], srcHSL); float[] dstHSL = new float[3]; ColorUtilities.RGBtoHSL(dst[0], dst[1], dst[2], dstHSL); ColorUtilities.HSLtoRGB(srcHSL[0], dstHSL[1], dstHSL[2], result); result[3] = Math.min(255, src[3] + dst[3] - (src[3] * dst[3]) / 255); } };
/** * <p>Returns the HSL (Hue/Saturation/Luminance) equivalent of a given * RGB color. All three HSL components are between 0.0 and 1.0.</p> * * @param color the RGB color to convert * @return a new array of 3 floats corresponding to the HSL components */ public static float[] RGBtoHSL(Color color) { return RGBtoHSL(color.getRed(), color.getGreen(), color.getBlue(), null); }
/** * <p>Returns the HSL (Hue/Saturation/Luminance) equivalent of a given * RGB color. All three HSL components are between 0.0 and 1.0.</p> * * @param color the RGB color to convert * @return a new array of 3 floats corresponding to the HSL components */ public static float[] RGBtoHSL(Color color) { return RGBtoHSL(color.getRed(), color.getGreen(), color.getBlue(), null); }
@Override void blend(int[] src, int[] dst, int[] result) { float[] srcHSL = new float[3]; ColorUtilities.RGBtoHSL(src[0], src[1], src[2], srcHSL); float[] dstHSL = new float[3]; ColorUtilities.RGBtoHSL(dst[0], dst[1], dst[2], dstHSL); ColorUtilities.HSLtoRGB(srcHSL[0], dstHSL[1], dstHSL[2], result); result[3] = Math.min(255, src[3] + dst[3] - (src[3] * dst[3]) / 255); } },
@Override void blend(int[] src, int[] dst, int[] result) { float[] srcHSL = new float[3]; ColorUtilities.RGBtoHSL(src[0], src[1], src[2], srcHSL); float[] dstHSL = new float[3]; ColorUtilities.RGBtoHSL(dst[0], dst[1], dst[2], dstHSL); ColorUtilities.HSLtoRGB(dstHSL[0], srcHSL[1], dstHSL[2], result); result[3] = Math.min(255, src[3] + dst[3] - (src[3] * dst[3]) / 255); } },