Java Utililty Methods HSV Color to HSB

List of utility methods to do HSV Color to HSB

Description

The list of methods to do HSV Color to HSB are organized into topic(s).

Method

voidhsvToRgb(float h, float s, float v, int[] rgb)
hsv To Rgb
float c = (Math.max(0f, Math.min(360f, v) / 256)) * Math.max(0f, Math.min(1f, s));
float hprime = (Math.max(0f, Math.min(256f, h)) / 60);
float x = c * (1 - Math.abs(hprime % 2 - 1));
float fr, fg, fb;
switch ((int) hprime) {
case 0:
    fr = c;
    fg = x;
...
inthsvToRGB(float hue, float saturation, float value)
hsv To RGB
int i = (int) (hue * 6.0F) % 6;
float f = hue * 6.0F - (float) i;
float f1 = value * (1.0F - saturation);
float f2 = value * (1.0F - f * saturation);
float f3 = value * (1.0F - (1.0F - f) * saturation);
float f4;
float f5;
float f6;
...
StringhsvToRgb(float hue, float saturation, float value)
hsv To Rgb
int h = (int) (hue * 6);
float f = hue * 6 - h;
float p = value * (1 - saturation);
float q = value * (1 - f * saturation);
float t = value * (1 - (1 - f) * saturation);
switch (h) {
case 0:
    return rgbToString(value, t, p);
...
inthsvToRGB(float p_181758_0_, float p_181758_1_, float p_181758_2_)
hsv To RGB
int i = (int) (p_181758_0_ * 6.0F) % 6;
float f = p_181758_0_ * 6.0F - (float) i;
float f1 = p_181758_2_ * (1.0F - p_181758_1_);
float f2 = p_181758_2_ * (1.0F - f * p_181758_1_);
float f3 = p_181758_2_ * (1.0F - (1.0F - f) * p_181758_1_);
float f4;
float f5;
float f6;
...
float[]HSVToRGB(float... hsv)
HSV To RGB
assert (hsv.length >= 3);
float h = hsv[0];
if (h < 0f)
    h += 1f;
float s = Math.min(Math.max(hsv[1], 0f), 1f);
float v = Math.min(Math.max(hsv[2], 0f), 1f);
float[] color = new float[4];
int i;
...
voidHSVtoRGB(float[] hsv, float[] rgb)
Convert an HSV color to RGB representation.
float f, p, q, t, hRound;
int hIndex;
float h, s, v;
h = hsv[0];
s = hsv[1];
v = hsv[2];
if (h < 0) {
    h = 0;
...
inthsvToRgb(int hue, int saturation, int value)
Converts the hue, saturation and value color model to the red, green and blue color model
hue %= 360;
float s = (float) saturation / 100;
float v = (float) value / 100;
float c = v * s;
float h = (float) hue / 60;
float x = c * (1 - Math.abs(h % 2 - 1));
float r, g, b;
switch (hue / 60) {
...