float f = -0.1f + hoverTimer / 60.0f + downTimer / 40.0f;
if (activated) {
f += 0.4f;
}
Color colFill1 = new Color(b.r + f, b.g + f, b.b + f, b.a);
f -= 0.1f;
Color colFill2 = new Color(b.r + f, b.g + f, b.b + f, b.a);
Color colBorder;
if (!enabled) {
f = 0;
} else if (activated) {
f = 0.2f;
} else {
f = -0.2f;
}
colBorder = new Color(b.r + f, b.g + f, b.b + f, b.a);
Color colCheck;
if (enabled) {
colCheck = Color.white;
} else {
colCheck = new Color(0.5f, 0.5f, 0.5f, 1.0f);
}
g.drawRectangle(x, y, width, height, colFill1, colFill1, colFill2, colFill2);
// Draw outer border
g.drawRectangle(x, y, width, 1, colBorder);
g.drawRectangle(x, y, 1, height,colBorder);
g.drawRectangle(x, y + height -1 , width, 1, colBorder);
g.drawRectangle(x + width - 1, y, 1, height, colBorder);
if (fnt != null && text != null) {
int decal = 0;
if (!selectable) {
decal = -height + 4;
}
fnt.setAlign(ADXFont.H_ALIGN_LEFT, ADXFont.V_ALIGN_MIDDLE);
g.drawText(fnt, text, x + height + decal + 1, y + height / 2 + 1, Color.black);
g.drawText(fnt, text, x + height + decal, y + height / 2, Color.white);
}
if (selectable && activated) {
g.drawRectangle(x + 8, y + 8, height - 16, 1, Color.white);
g.drawRectangle(x + 8, y + height - 9, height - 16, 1, Color.white);
g.drawRectangle(x + 8, y + 8, 1, height - 16, Color.white);
g.drawRectangle(x + height - 9, y + 8, 1, height - 16, Color.white);
g.drawRectangle(x + 8, y + 8, height - 16, height - 16, new Color(colCheck.r, colCheck.g, colCheck.b, colCheck.a - 0.5f));
}
}