Java Integer Format format(int color)

Here you can find the source of format(int color)

Description

format

License

Open Source License

Parameter

Parameter Description
color a parameter

Return

String color representation

Declaration

public static String format(int color) 

Method Source Code

//package com.java2s;
/**//ww  w . j a v a2  s .c  om
 * Anderground project - Subway maps processor application.
 * Copyright (C) 2008-2009 Eldar Abusalimov, Ilya Shurigyn
 * 
 * This file is part of Anderground.
 * 
 * Anderground is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 * 
 * Anderground is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with Anderground.  If not, see <http://www.gnu.org/licenses/>.
 */

public class Main {
    /**
     * 
     * @param color
     * @return String color representation
     */
    public static String format(int color) {
        return '#' + Integer.toHexString(0xFFFFFF & color);
    }
}

Related

  1. convertInt2Percent(int num)
  2. format(int c)
  3. format(int i, int fillLength)
  4. format(int i, int length, boolean left_justify, char fill)
  5. format(int intval)
  6. format(int num)