Beatmup Java package
Beatmup.Imaging.FloatColor Class Reference

Floating-point RGBA color value. More...

Public Member Functions

 FloatColor ()
 Creates a zero-valued color. More...
 
 FloatColor (float r, float g, float b, float a)
 Creates a color by aggregating the four channels values components. More...
 
Color getIntColor ()
 

Public Attributes

float r
 red More...
 
float g
 green More...
 
float b
 blue More...
 
float a
 alpha More...
 

Detailed Description

Floating-point RGBA color value.

Definition at line 24 of file FloatColor.java.

Constructor & Destructor Documentation

◆ FloatColor() [1/2]

Beatmup.Imaging.FloatColor.FloatColor ( )
inline

Creates a zero-valued color.

Definition at line 33 of file FloatColor.java.

33  {
34  r = g = b = a = 0;
35  }

◆ FloatColor() [2/2]

Beatmup.Imaging.FloatColor.FloatColor ( float  r,
float  g,
float  b,
float  a 
)
inline

Creates a color by aggregating the four channels values components.

Parameters
rthe red channel value
gthe green channel value
bthe blue channel value
athe alpha channel value

Definition at line 44 of file FloatColor.java.

44  {
45  this.r = r;
46  this.g = g;
47  this.b = b;
48  this.a = a;
49  // This constructor is called by JNI, do not remove it.
50  }

Member Function Documentation

◆ getIntColor()

Color Beatmup.Imaging.FloatColor.getIntColor ( )
inline
Returns
an integer approximation of the current color mapping [0, 1] input range to [0, 255] output range.

Definition at line 55 of file FloatColor.java.

55  {
56  return new Color(Math.round(r * 255), Math.round(g * 255), Math.round(b * 255), Math.round(a * 255));
57  }

Member Data Documentation

◆ r

float Beatmup.Imaging.FloatColor.r

red

Definition at line 25 of file FloatColor.java.

◆ g

float Beatmup.Imaging.FloatColor.g

green

Definition at line 26 of file FloatColor.java.

◆ b

float Beatmup.Imaging.FloatColor.b

blue

Definition at line 27 of file FloatColor.java.

◆ a

float Beatmup.Imaging.FloatColor.a

alpha

Definition at line 28 of file FloatColor.java.


The documentation for this class was generated from the following file: