Package yash.oklab
Class Ok
java.lang.Object
yash.oklab.Ok
Oklab for Processing.
Translated (with added functions) by Yash Gupta to
Processing code, from the file 'colorconversion.js'
on GitHub by Björn Ottosson.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic floatgetH(int input) returns the hue parameter of a color, relative to the OkHSV and OkHSL scales.static float[]getHSL(int input) returns an array containing OkHSL and alpha values of a color.static float[]getHSV(int input) returns an array containing OkHSV and alpha values of a color.static floatgetL(int input) returns the lightness parameter of a color, relative to the OkHSL scale.static floatgetS(int input) returns the saturation parameter of a color, relative to the OkHSV and OkHSL scales.static floatgetV(int input) returns the value parameter of a color, relative to the OkHSV scale.static intHSL(float L) returns a grayscale OkHSL color.static intHSL(float L, float A) returns a grayscale OkHSL color with custom alpha value.static intHSL(float H, float S, float L) returns OkHSL color.static intHSL(float H, float S, float L, float A) returns OkHSL color with custom alpha value.static intHSV(float V) returns a grayscale OkHSV color.static intHSV(float V, float A) returns a grayscale OkHSV color with custom alpha value.static intHSV(float H, float S, float V) returns OkHSV color.static intHSV(float H, float S, float V, float A) returns OkHSV color with custom alpha value.
-
Field Details
-
p
-
-
Constructor Details
-
Ok
a Constructor.- Parameters:
q- the parent PApplet
-
-
Method Details
-
HSV
public static int HSV(float H, float S, float V) returns OkHSV color.- Parameters:
H- hue between 0 and 360.S- saturation between 0 and 100.V- value between 0 and 100.- Returns:
- int
-
HSV
public static int HSV(float H, float S, float V, float A) returns OkHSV color with custom alpha value.- Parameters:
H- hue between 0 and 360.S- saturation between 0 and 100.V- value between 0 and 100.A- alpha between 0 and 100.- Returns:
- int
-
HSV
public static int HSV(float V) returns a grayscale OkHSV color.- Parameters:
V- value between 0 and 100.- Returns:
- int
-
HSV
public static int HSV(float V, float A) returns a grayscale OkHSV color with custom alpha value.- Parameters:
V- value between 0 and 100.A- alpha between 0 and 100.- Returns:
- int
-
HSL
public static int HSL(float H, float S, float L) returns OkHSL color.- Parameters:
H- hue between 0 and 360.S- saturation between 0 and 100.L- value between 0 and 100.- Returns:
- int
-
HSL
public static int HSL(float H, float S, float L, float A) returns OkHSL color with custom alpha value.- Parameters:
H- hue between 0 and 360.S- saturation between 0 and 100.L- value between 0 and 100.A- alpha between 0 and 100.- Returns:
- int
-
HSL
public static int HSL(float L) returns a grayscale OkHSL color.- Parameters:
L- value between 0 and 100.- Returns:
- int
-
HSL
public static int HSL(float L, float A) returns a grayscale OkHSL color with custom alpha value.- Parameters:
L- value between 0 and 100.A- alpha between 0 and 100.- Returns:
- int
-
getHSV
public static float[] getHSV(int input) returns an array containing OkHSV and alpha values of a color.- Parameters:
input- color value.- Returns:
- float[]
-
getHSL
public static float[] getHSL(int input) returns an array containing OkHSL and alpha values of a color.- Parameters:
input- color value.- Returns:
- float[]
-
getH
public static float getH(int input) returns the hue parameter of a color, relative to the OkHSV and OkHSL scales.- Parameters:
input- color value.- Returns:
- float
-
getS
public static float getS(int input) returns the saturation parameter of a color, relative to the OkHSV and OkHSL scales.- Parameters:
input- color value.- Returns:
- float
-
getV
public static float getV(int input) returns the value parameter of a color, relative to the OkHSV scale.- Parameters:
input- color value.- Returns:
- float
-
getL
public static float getL(int input) returns the lightness parameter of a color, relative to the OkHSL scale.- Parameters:
input- color value.- Returns:
- float
-