@@ -1767,6 +1767,15 @@ public PdfFont getFont() {
1767
1767
return font ;
1768
1768
}
1769
1769
1770
+ /**
1771
+ * Gets the current color of the form field.
1772
+ *
1773
+ * @return the current {@link Color color}
1774
+ */
1775
+ public Color getColor () {
1776
+ return color ;
1777
+ }
1778
+
1770
1779
/**
1771
1780
* Basic setter for the <code>font</code> property. Regenerates the field
1772
1781
* appearance after setting the new value.
@@ -3482,8 +3491,8 @@ private void retrieveStyles() {
3482
3491
if (subType != null && subType .equals (PdfName .Widget )) {
3483
3492
PdfDictionary appearanceCharacteristics = getPdfObject ().getAsDictionary (PdfName .MK );
3484
3493
if (appearanceCharacteristics != null ) {
3485
- backgroundColor = getColor (appearanceCharacteristics , PdfName .BG );
3486
- Color extractedBorderColor = getColor (appearanceCharacteristics , PdfName .BC );
3494
+ backgroundColor = appearancePropToColor (appearanceCharacteristics , PdfName .BG );
3495
+ Color extractedBorderColor = appearancePropToColor (appearanceCharacteristics , PdfName .BC );
3487
3496
if (extractedBorderColor != null )
3488
3497
borderColor = extractedBorderColor ;
3489
3498
}
@@ -3498,7 +3507,7 @@ private void retrieveStyles() {
3498
3507
}
3499
3508
}
3500
3509
3501
- private Color getColor (PdfDictionary appearanceCharacteristics , PdfName property ) {
3510
+ private Color appearancePropToColor (PdfDictionary appearanceCharacteristics , PdfName property ) {
3502
3511
PdfArray colorData = appearanceCharacteristics .getAsArray (property );
3503
3512
if (colorData != null ) {
3504
3513
float [] backgroundFloat = new float [colorData .size ()];
0 commit comments