package com.din.and.sprj.main;
import android.graphics.*;
public class Define_Color {
final static int RED = 0;
final static int LIGHTCORAL = 1;
final static int ORANGERED = 2;
final static int ORANGE = 3;
final static int GOLD = 4;
final static int YELLOW = 5;
final static int LAWNGREEN = 6;
final static int LIMEGREEN = 7;
final static int GREEN = 8;
final static int SPRINGGREEN = 9;
final static int LIGHTSEAGREEN = 10;
final static int STEELBLUE = 11;
final static int DODGEBLUE = 12;
final static int DARKBLUE = 13;
final static int SLATEBLUE = 14;
final static int DARKVIOLET = 15;
final static int INDIGO = 16;
final static int DEEPPINK = 17;
final static int PALEVIOLETRED = 18;
final static int LIGHTGREY = 19;
final static int DIMGRAY = 20;
int position;
public Define_Color(int position) {
// TODO Auto-generated constructor stub
this.position = position;
}
public int d_Color(){
switch(position){
case RED:
return Color.rgb(255, 0, 0);
case LIGHTCORAL:
return Color.rgb(240, 128, 128);
case ORANGERED:
return Color.rgb(255, 69, 0);
case ORANGE:
return Color.rgb(255, 165, 0);
case GOLD:
return Color.rgb(255, 215, 0);
case YELLOW:
return Color.rgb(255, 255, 0);
case LAWNGREEN:
return Color.rgb(124, 252, 0);
case LIMEGREEN:
return Color.rgb(50, 205, 50);
case GREEN:
return Color.rgb(34, 139, 34);
case SPRINGGREEN:
return Color.rgb(0, 255, 127);
case LIGHTSEAGREEN:
return Color.rgb(32, 178, 170);
case STEELBLUE:
return Color.rgb(70, 130, 180);
case DODGEBLUE:
return Color.rgb(30, 144, 255);
case DARKBLUE:
return Color.rgb(0, 0, 255);
case SLATEBLUE:
return Color.rgb(106, 90, 205);
case DARKVIOLET:
return Color.rgb(148, 0, 211);
case INDIGO:
return Color.rgb(238, 130, 238);
case DEEPPINK:
return Color.rgb(255, 20, 147);
case PALEVIOLETRED:
return Color.rgb(219, 1
Define_Color dc = new Define_Color(position);
int d_color = dc.d_Color(); //정의한 칼라 변수에 삽입
ratebar.setColorFilter(new PorterDuffColorFilter(d_color, PorterDuff.Mode.LIGHTEN));
//ratebar.setColorFilter(new PorterDuffColorFilter(Color.BLUE, PorterDuff.Mode.DARKEN));
float p_rate = 20+(rating.getRate()*11); //바 크기 조절
ImageView ratebar = (ImageView)convertView.findViewById(R.id.row);
ratebar.setImageResource(rating.getRow());
//ratebar.getScaleType();
ratebar.setMaxWidth((int) p_rate); //바 크기 조정