-
Notifications
You must be signed in to change notification settings - Fork 4
/
GamaColorRecord.java
72 lines (62 loc) · 1.51 KB
/
GamaColorRecord.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
/*******************************************************************************************************
*
* GamaColorRecord.java, in ummisco.gama.serialize, is part of the source code of the GAMA modeling and simulation
* platform (v.1.9.2).
*
* (c) 2007-2023 UMI 209 UMMISCO IRD/SU & Partners (IRIT, MIAT, TLU, CTU)
*
* Visit https://github.com/gama-platform/gama for license information and contacts.
*
********************************************************************************************************/
package ummisco.gama.serializer.gamaType.reduced;
import msi.gama.util.GamaColor;
/**
* The GamaColorRecord.
*/
public class GamaColorRecord {
/** The r. */
float r;
/** The g. */
float g;
/** The b. */
float b;
/** The a. */
float a;
/**
* Instantiates a new gama color record.
*
* @author Alexis Drogoul (alexis.drogoul@ird.fr)
* @param r
* the r.
* @param g
* the g.
* @param b
* the b.
* @param a
* the a.
* @date 30 mai 2023
*/
public GamaColorRecord(final float r, final float g, final float b, final float a) {
this.r = r;
this.g = g;
this.b = b;
this.a = a;
}
/**
* Instantiates a new gama color reducer.
*
* @param c
* the c
*/
public GamaColorRecord(final GamaColor c) {
this(c.red(), c.green(), c.blue(), c.alpha());
}
/**
* Construct object.
*
* @return the object
*/
public GamaColor constructObject() {
return new GamaColor(r / 255d, g / 255d, b / 255d, a / 255d);
}
}