Java Hex String Create appendHex(int color, StringBuffer buffer)

Here you can find the source of appendHex(int color, StringBuffer buffer)

Description

append Hex

License

Open Source License

Declaration

protected static void appendHex(int color, StringBuffer buffer) 

Method Source Code

//package com.java2s;
/*******************************************************************************
 * Copyright (c) 2012 Sierra Wireless and others.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:/*from   w  ww  .  j  a va2s.com*/
 *     Sierra Wireless - initial API and implementation
 *******************************************************************************/

public class Main {
    protected static void appendHex(int color, StringBuffer buffer) {
        String string = Integer.toHexString(color).toUpperCase();
        if (string.length() == 1) {
            buffer.append("0"); //$NON-NLS-1$
        }
        buffer.append(string);
    }
}

Related

  1. appendHex(final StringBuffer buf, final byte i)
  2. appendHex(final StringBuffer buf, final int i)
  3. appendHex(StringBuffer buf, int x)
  4. appendHex(StringBuffer buffer, byte b)
  5. appendHex(StringBuffer buffer, int value)
  6. appendHex(StringBuffer sb, byte b)