@@ -16,7 +16,7 @@ public class RGB {
16
16
17
17
private String output = null ;
18
18
private boolean percent = false ;
19
- boolean isCss3 = false ;
19
+ boolean isModernCss = false ;
20
20
21
21
CssValue vr , vg , vb ;
22
22
@@ -27,10 +27,10 @@ public static final CssValue filterValue(ApplContext ac, CssValue val)
27
27
// might need to extend...
28
28
} else {
29
29
if (val .getType () == CssTypes .CSS_NUMBER ) {
30
- boolean isCss3 = (ac .getCssVersion ().compareTo (CssVersion .CSS3 ) >= 0 );
30
+ boolean IsModernCss = (ac .getCssVersion ().compareTo (CssVersion .CSS3 ) >= 0 );
31
31
CssCheckableValue v = val .getCheckableValue ();
32
32
// in CSS2, numbers can only be integers
33
- if (!isCss3 ) {
33
+ if (!IsModernCss ) {
34
34
if (!v .isInteger ()) {
35
35
throw new InvalidParamException ("rgb" , val , ac );
36
36
}
@@ -71,7 +71,6 @@ public static final CssValue filterValue(ApplContext ac, CssValue val)
71
71
public final void setRed (ApplContext ac , CssValue val )
72
72
throws InvalidParamException {
73
73
output = null ;
74
- isCss3 = (ac .getCssVersion ().compareTo (CssVersion .CSS3 ) >= 0 );
75
74
vr = filterValue (ac , val );
76
75
}
77
76
@@ -130,14 +129,14 @@ public RGB(int r, int g, int b) {
130
129
/**
131
130
* Create a new RGB with default values
132
131
*
133
- * @param isCss3 a boolean toggling the output of RGB
134
- * @param r the red channel, an <EM>int</EM>
135
- * @param g the green channel, an <EM>int</EM>
136
- * @param b the blue channel, an <EM>int</EM>
132
+ * @param isModernCss a boolean toggling the output of RGB
133
+ * @param r the red channel, an <EM>int</EM>
134
+ * @param g the green channel, an <EM>int</EM>
135
+ * @param b the blue channel, an <EM>int</EM>
137
136
*/
138
- public RGB (boolean isCss3 , int r , int g , int b ) {
137
+ public RGB (boolean isModernCss , int r , int g , int b ) {
139
138
this (r , g , b );
140
- this .isCss3 = isCss3 ;
139
+ this .isModernCss = isModernCss ;
141
140
}
142
141
143
142
public boolean equals (RGB other ) {
@@ -151,13 +150,18 @@ protected void setRepresentationString(String s) {
151
150
output = s ;
152
151
}
153
152
153
+ protected void setModernStyle (boolean isModernCss ) {
154
+ this .isModernCss = isModernCss ;
155
+ output = null ;
156
+ }
157
+
154
158
/**
155
159
* Returns a string representation of the object.
156
160
*/
157
161
public String toString () {
158
162
if (output == null ) {
159
163
StringBuilder sb = new StringBuilder (functionname ).append ('(' );
160
- if (isCss3 ) {
164
+ if (isModernCss ) {
161
165
sb .append (vr ).append (' ' ).append (vg ).append (' ' ).append (vb ).append (')' );
162
166
} else {
163
167
sb .append (vr ).append (", " );
0 commit comments