Changeset 6899 in josm
- Timestamp:
- 2014-03-06T20:42:57+01:00 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/ExpressionFactory.java
r6896 r6899 19 19 import java.util.regex.Matcher; 20 20 import java.util.regex.Pattern; 21 import java.util.zip.CRC32; 21 22 22 23 import org.openstreetmap.josm.Main; … … 204 205 205 206 /** 207 * Create color from hsb color model. (arguments form 0.0 to 1.0) 208 * @param h hue 209 * @param s saturation 210 * @param b brightness 211 * @return the corresponding color 212 */ 213 public static Color hsb_color(float h, float s, float b) { 214 try { 215 return Color.getHSBColor(h, s, b); 216 } catch (IllegalArgumentException e) { 217 return null; 218 } 219 } 220 221 /** 206 222 * Creates a color value from an HTML notation, i.e., {@code #rrggbb}. 207 223 */ … … 552 568 public static String XML_encode(String s) { 553 569 return s == null ? null : XmlWriter.encode(s); 570 } 571 572 /** 573 * Calculate the CRC32 checksum from a string 574 * @param s the string 575 * @return long value from 0 to 2^32-1 576 */ 577 public static long CRC32_checksum(String s) { 578 CRC32 cs = new CRC32(); 579 cs.update(s.getBytes()); 580 return cs.getValue(); 554 581 } 555 582 }
Note:
See TracChangeset
for help on using the changeset viewer.