Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
import java.util.HashMap;
import java.util.Map;

public class Main {
    private static Map<String, String> colorToHexMap = new HashMap<String, String>();

    public static String colorToHex(String color) {
        if (colorToHexMap.containsKey(color.toLowerCase())) {
            return colorToHexMap.get(color.toLowerCase());
        }

        return color;
    }
}