~ubuntu-branches/ubuntu/oneiric/tuxguitar/oneiric

« back to all changes in this revision

Viewing changes to src/org/herac/tuxguitar/song/models/RGBColor.java

  • Committer: Bazaar Package Importer
  • Author(s): Philippe Coval
  • Date: 2007-02-04 01:41:23 UTC
  • Revision ID: james.westby@ubuntu.com-20070204014123-9pv7okph0iaiqkvw
Tags: upstream-0.9.1
ImportĀ upstreamĀ versionĀ 0.9.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
package org.herac.tuxguitar.song.models;
 
2
 
 
3
public class RGBColor {
 
4
        public static final RGBColor RED = new RGBColor(255,0,0);
 
5
        public static final RGBColor GREEN = new RGBColor(0,255,0);
 
6
        public static final RGBColor BLUE = new RGBColor(0,0,255);
 
7
        public static final RGBColor WHITE = new RGBColor(255,255,255);
 
8
        public static final RGBColor BLACK = new RGBColor(0,0,0);
 
9
        
 
10
        private int r;
 
11
        private int g;
 
12
        private int b;
 
13
        
 
14
        public RGBColor(int r,int g,int b){
 
15
                this.r = r;
 
16
                this.g = g;
 
17
                this.b = b;
 
18
        }
 
19
        
 
20
        public int getB() {
 
21
                return b;
 
22
        }
 
23
 
 
24
        public void setB(int b) {
 
25
                this.b = b;
 
26
        }
 
27
 
 
28
        public int getG() {
 
29
                return g;
 
30
        }
 
31
 
 
32
        public void setG(int g) {
 
33
                this.g = g;
 
34
        }
 
35
 
 
36
        public int getR() {
 
37
                return r;
 
38
        }
 
39
 
 
40
        public void setR(int r) {
 
41
                this.r = r;
 
42
        }
 
43
        
 
44
        public boolean isEqual(RGBColor color){
 
45
                return (this.getR() == color.getR() && this.getG() == color.getG() && this.getB() == color.getB());
 
46
        }
 
47
        
 
48
        public Object clone(){
 
49
            return new RGBColor(getR(),getG(),getB());
 
50
        }
 
51
        
 
52
}