package de.frajul.endlessroll.data;

import de.frajul.endlessroll.main.GameLog;

/**
 * Created by Julian on 02.08.2016.
 */
public class Color {

    private float r, g, b;

    public Color() {
    }

    public Color(float r, float g, float b) {
        this.r = r;
        this.g = g;
        this.b = b;
    }

    public Color(Color other) {
        this.r = other.getR();
        this.g = other.getG();
        this.b = other.getB();
    }

    public Color interpolate(float leftValue, float rightValue, Color color2) {
        float r = this.r + (color2.r - this.r) * leftValue;
        float g = this.g + (color2.g - this.g) * leftValue;
        float b = this.b + (color2.b - this.b) * leftValue;
        return new Color(r, g, b);
    }

    private void mul(float a) {
        r *= a;
        g *= a;
        b *= a;
    }

    private void add(Color other) {
        r += other.getR();
        g += other.getG();
        b += other.getB();
    }

    public float getR() {
        return r;
    }

    public void setR(float r) {
        this.r = r;
    }

    public float getG() {
        return g;
    }

    public void setG(float g) {
        this.g = g;
    }

    public float getB() {
        return b;
    }

    public void setB(float b) {
        this.b = b;
    }
}
