Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
import android.graphics.Color;

public class Main {
    /**
     * Shifts the hue by the offset specified
     * @param color
     * @param offset
     * @return shifted color
     */
    public static int shiftColorHue(int color, float offset) {
        float[] colorShiftHSV = new float[3];
        Color.colorToHSV(color, colorShiftHSV);
        colorShiftHSV[0] = (colorShiftHSV[0] + offset) % 360;

        return Color.HSVToColor(colorShiftHSV);
    }
}