Hello.
My code describes Color classes:
abstract class Color{
private final int H=45;
private int V;
private int S;
Color(int V,int S){
this.V=V;
this.S=S;
}
public int getV(){
return V;
}
public int getS(){
return S;
}
public void setV(int V){
this.V=V;
}
abstract void print();
}
class Black extends Color{
Black(){
super(0,0);
}
@Override
public void print(){ System.out.println("Black"); }
}
abstract class Dekorator extends Color{
Color color;
Dekorator(Color color){
super(color.getV(),color.getS());
}
@Override
public void print(){
color.print();
}
class MoreVvalue extends Dekorator{
private final int Vplus=15;
MoreVvalue(Color color){
super(color);
}
@Override
public void setV(int Vplus) {
super.setV(Vplus);
}
}
Using a decorator pattern i want to create brighter version(setting the V by adding to its crrent value 15) of black color. Please help.