From dee9bbc5f97077aaa51cc5be51dff3679c4846cf Mon Sep 17 00:00:00 2001 From: "ray.j.greenwell" Date: Mon, 9 Nov 2009 20:48:47 +0000 Subject: [PATCH] Callers can add their own prefix. git-svn-id: https://samskivert.googlecode.com/svn/trunk@2644 6335cc39-0255-0410-8fd6-9bcaacd3b74c --- src/java/com/samskivert/util/StringUtil.java | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/src/java/com/samskivert/util/StringUtil.java b/src/java/com/samskivert/util/StringUtil.java index 10ef93a6..3111734c 100644 --- a/src/java/com/samskivert/util/StringUtil.java +++ b/src/java/com/samskivert/util/StringUtil.java @@ -334,22 +334,12 @@ public class StringUtil } /** - * Format the specified int as a String color value, like "0x000000". + * Format the specified int as a String color value, like "000000". You might want + * to add a prefix like "#" or "0x", depending on your usage. */ public static String toColorString (int c) { - return toColorString(c, "0x"); - } - - /** - * Format the specified int as a String color value. - * - * @param c the int value to format. - * @param prefix something like "0x" or "#", or just "". - */ - public static String toColorString (int c, String prefix) - { - return prefix + prepad(Integer.toHexString(c), 6, '0'); + return prepad(Integer.toHexString(c), 6, '0'); } /**