private void createAppearances(PdfContentByte cb, PdfFormField field,
String onValue, float width, float height, boolean normal,
FSColor color, FSColor darker) {
// XXX Should cache this by width and height, but they're small so
// don't bother for now...
PdfAppearance tpOff = cb.createAppearance(width, height);
PdfAppearance tpOn = cb.createAppearance(width, height);
setStrokeColor(tpOn, color);
setStrokeColor(tpOff, color);
float sLen = Math.min(width - reduce(width), height - reduce(height));
if (!normal) {
setFillColor(tpOff, darker);
tpOff.rectangle(0, 0, width, height);
tpOff.fill();
setFillColor(tpOn, darker);
tpOn.rectangle(0, 0, width, height);
tpOn.fill();
}
tpOn.moveTo(width / 2 - sLen / 2, height / 2 - sLen / 2);
tpOn.lineTo(width / 2 + sLen / 2, height / 2 + sLen / 2);
tpOn.moveTo(width / 2 - sLen / 2, height / 2 + sLen / 2);
tpOn.lineTo(width / 2 + sLen / 2, height / 2 - sLen / 2);
tpOn.stroke();
if (normal) {
field.setAppearance(PdfAnnotation.APPEARANCE_NORMAL, OFF_STATE, tpOff);
field.setAppearance(PdfAnnotation.APPEARANCE_NORMAL, onValue, tpOn);
} else {