change Color HSB - Android Graphics

Android examples for Graphics:Change Color

Description

change Color HSB

Demo Code


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

public class Main {
    public static String changeColorHSB(String color) {
        float[] hsv = new float[3];
        int brandColor = Color.parseColor(color);
        Color.colorToHSV(brandColor, hsv);
        hsv[1] = hsv[1] + 0.1f;// w  w  w .  j av a2 s.co  m
        hsv[2] = hsv[2] - 0.1f;
        int argbColor = Color.HSVToColor(hsv);
        String hexColor = String.format("#%08X", argbColor);
        return hexColor;
    }
}

Related Tutorials