get Quake Color - Android Graphics

Android examples for Graphics:Color Value

Description

get Quake Color

Demo Code


//package com.java2s;

public class Main {
    public static String getQuakeColor(double magnitude) {
        if (magnitude > 0.0) {
            if (magnitude < 1.0)
                return "#00FF00";
            else if (magnitude < 2.0)
                return "#1CE300";
            else if (magnitude < 3.0)
                return "#39C600";
            else if (magnitude < 4.0)
                return "#55AA00";
            else if (magnitude < 5.0)
                return "#718E00";
            else if (magnitude < 6.0)
                return "#8E7100";
            else if (magnitude < 7.0)
                return "#AA5500";
            else if (magnitude < 8.0)
                return "#C63900";
            else if (magnitude < 9.0)
                return "#E31C00";
            else if (magnitude < 10.0)
                return "#FF0000";
            else/*  w w w .ja va  2s .  c o m*/
                return "#BDBDBD";
        } else
            return "#BDBDBD";
    }
}

Related Tutorials