com.rngtng.launchpad
Class LColor

java.lang.Object
  extended by com.rngtng.launchpad.LColor

public class LColor
extends java.lang.Object

The Color class, to handle the MIDI Color and Mode codes

Author:
rngtng - Tobias Bielohlawek

Field Summary
static int BUFFERED
           
static int FLASHING
           
static int GREEN_HIGH
           
static int GREEN_LOW
           
static int GREEN_MEDIUM
           
static int GREEN_OFF
           
static int GREEN_OFFSET
           
static int HIGH
           
static int LOW
           
static int MEDIUM
           
static int NORMAL
           
static int OFF
           
static int RED_HIGH
           
static int RED_LOW
           
static int RED_MEDIUM
           
static int RED_OFF
           
static int YELLOW_HIGH
           
static int YELLOW_LOW
           
static int YELLOW_MEDIUM
           
static int YELLOW_OFF
           
 
Constructor Summary
LColor()
          creates default black color
LColor(int _color)
          creates color with given red/green and mode value
LColor(int red, int green)
          creates color with given red and green value, green can be 0-3 or Constants
LColor(int red, int green, int mode)
          creates color with given red and green value, green can be 0-3 or Constants
 
Method Summary
 int getGreen()
          Returns the value of green
 int getMode()
          Returns the value of mode
 int getRed()
          Returns the value of Red
 boolean is(int color)
          Compares color with given int value
 boolean is(LColor color)
          Compares color with given LColor value
 boolean isGreen(int green)
          Compares red color value with given int value
 boolean isMode(int mode)
          Compares red color value with given int value
 boolean isRed(int red)
          Compares red color value with given int value
 void setGreen(int green)
          Set the value of green
 void setMode(int mode)
          Set the value of mode
 void setRed(int red)
          Set the value of Red
 int velocity()
          Calculates the MIDI data 2 value (velocity) for given brightness and mode values.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

OFF

public static final int OFF
See Also:
Constant Field Values

LOW

public static final int LOW
See Also:
Constant Field Values

MEDIUM

public static final int MEDIUM
See Also:
Constant Field Values

HIGH

public static final int HIGH
See Also:
Constant Field Values

RED_OFF

public static final int RED_OFF
See Also:
Constant Field Values

RED_LOW

public static final int RED_LOW
See Also:
Constant Field Values

RED_MEDIUM

public static final int RED_MEDIUM
See Also:
Constant Field Values

RED_HIGH

public static final int RED_HIGH
See Also:
Constant Field Values

GREEN_OFFSET

public static final int GREEN_OFFSET
See Also:
Constant Field Values

GREEN_OFF

public static final int GREEN_OFF
See Also:
Constant Field Values

GREEN_LOW

public static final int GREEN_LOW
See Also:
Constant Field Values

GREEN_MEDIUM

public static final int GREEN_MEDIUM
See Also:
Constant Field Values

GREEN_HIGH

public static final int GREEN_HIGH
See Also:
Constant Field Values

YELLOW_OFF

public static final int YELLOW_OFF
See Also:
Constant Field Values

YELLOW_LOW

public static final int YELLOW_LOW
See Also:
Constant Field Values

YELLOW_MEDIUM

public static final int YELLOW_MEDIUM
See Also:
Constant Field Values

YELLOW_HIGH

public static final int YELLOW_HIGH
See Also:
Constant Field Values

BUFFERED

public static final int BUFFERED
See Also:
Constant Field Values

FLASHING

public static final int FLASHING
See Also:
Constant Field Values

NORMAL

public static final int NORMAL
See Also:
Constant Field Values
Constructor Detail

LColor

public LColor()
creates default black color


LColor

public LColor(int red,
              int green)
creates color with given red and green value, green can be 0-3 or Constants

Parameters:
red - red value
green - green value

LColor

public LColor(int red,
              int green,
              int mode)
creates color with given red and green value, green can be 0-3 or Constants

Parameters:
red - Red value
green - Green value
mode - Mode value

LColor

public LColor(int _color)
creates color with given red/green and mode value

Parameters:
_color - color value
Method Detail

velocity

public int velocity()
Calculates the MIDI data 2 value (velocity) for given brightness and mode values. *

Returns:
integer to be used for MIDI data 2 Errors raised: [Launchpad::NoValidBrightnessError] when brightness values aren't within the valid range

getRed

public int getRed()
Returns the value of Red

Returns:
red value

setRed

public void setRed(int red)
Set the value of Red

Parameters:
red -

getGreen

public int getGreen()
Returns the value of green

Returns:
green value

setGreen

public void setGreen(int green)
Set the value of green

Parameters:
green -

getMode

public int getMode()
Returns the value of mode

Returns:
mode value

setMode

public void setMode(int mode)
Set the value of mode

Parameters:
mode -

is

public boolean is(int color)
Compares color with given int value

Parameters:
color -
Returns:
true if color is equal

is

public boolean is(LColor color)
Compares color with given LColor value

Parameters:
color -
Returns:
true if color is equal

isRed

public boolean isRed(int red)
Compares red color value with given int value

Parameters:
red -
Returns:
true if color is equal

isGreen

public boolean isGreen(int green)
Compares red color value with given int value

Parameters:
green -
Returns:
true if color is equal

isMode

public boolean isMode(int mode)
Compares red color value with given int value

Parameters:
mode -
Returns:
true if color is equal


processing library launchpad by rngtng - Tobias Bielohlawek. (c) 2011