w = (yx - xy) * s; return new Vector4f(x, y, z, w);
/** * Used to set focused stroke color vector. * * @param r red value. * @param g green value. * @param b blue value. * @param a alpha value. */ public void setFocusedStrokeColor(float r, float g, float b, float a) { focusedStrokeColor.set(r, g, b, a); }
/** * Used to create negative color for provided color. Alpha value will be the same as in source color. * * @param color color to negotiate. * * @return new negative color. */ public static Vector4f negativeColor(Vector4f color) { Vector4f dest = new Vector4f(1).sub(color); dest.w = color.w; return dest; }
/** * Used to create negative color and set it to dest. Alpha value will be the same as in source color. * * @param color color to negotiate. * @param dest target color object to set. */ public static void negativeColor(Vector4f color, Vector4f dest) { dest.zero().set(1).sub(color); dest.w = color.w; }
public Vector4f transform(float x, float y, float z, float w, Vector4f dest) { dest.x = x; dest.y = y; dest.z = z; dest.w = w; return dest.mul(this); }
public Vector4f transform(float x, float y, float z, float w, Vector4f dest) { dest.x = x; dest.y = y; dest.z = z; dest.w = w; return dest.mul(this); }
/** * Used to create negative color and set it to dest. Alpha value will be setted to 1. * * @param color color to negotiate. * @param dest target color object to set. * * @return destination color filled with negative color. */ public static Vector4f negativeColorRGB(Vector4f color, Vector4f dest) { dest.zero().set(1).sub(color); dest.w = 1; return dest; }
/** * Returns vector of four border radius elements where: x = top left, y = top right, z = bottom right, w = bottom left * * @return vector of four border radius. */ public Vector4f getBorderRadius() { return new Vector4f(borderTopLeftRadius == null ? 0 : borderTopLeftRadius, borderTopRightRadius == null ? 0 : borderTopRightRadius, borderBottomRightRadius == null ? 0 : borderBottomRightRadius, borderBottomLeftRadius == null ? 0 : borderBottomLeftRadius); }
public Vector4f transform(Vector4f v) { return v.mul(this); }
/** * Used to set background color vector. * * @param r red value. * @param g green value. * @param b blue value. * @param a alpha value. */ public void setColor(float r, float g, float b, float a) { color.set(r, g, b, a); }
/** * Light-gray color vector. * * @return Vector4f lightGray color. */ public static Vector4f lightGray() { return new Vector4f(lightGray); }
public Vector4f transform(Vector4f v) { return v.mul(this); }
/** * Read this vector from the supplied {@link ByteBuffer} at the current * buffer {@link ByteBuffer#position() position}. * <p> * This method will not increment the position of the given ByteBuffer. * <p> * In order to specify the offset into the ByteBuffer at which * the vector is read, use {@link #set(int, ByteBuffer)}, taking * the absolute position as parameter. * * @param buffer * values will be read in <code>x, y, z, w</code> order * @return this * @see #set(int, ByteBuffer) */ public Vector4f set(ByteBuffer buffer) { return set(buffer.position(), buffer); }
/** * Returns allow color. * * @return allow color. */ public Vector4f allowColor() { return allowColor == null ? null : new Vector4f(allowColor); }