Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@

package com.github.mikephil.charting.utils;

import android.content.res.Resources;
import android.graphics.Color;

import java.util.ArrayList;
Expand Down Expand Up @@ -62,7 +61,7 @@ public static int rgb(String hex) {
int color = (int) Long.parseLong(hex.replace("#", ""), 16);
int r = (color >> 16) & 0xFF;
int g = (color >> 8) & 0xFF;
int b = (color >> 0) & 0xFF;
int b = (color) & 0xFF;
return Color.rgb(r, g, b);
}

Expand All @@ -81,23 +80,7 @@ public static int colorWithAlpha(int color, int alpha) {
return (color & 0xffffff) | ((alpha & 0xff) << 24);
}

/**
* turn an array of resource-colors (contains resource-id integers) into an
* array list of actual color integers
* @param colors an integer array of resource id's of colors
*/
public static List<Integer> createColors(Resources r, int[] colors) {

List<Integer> result = new ArrayList<>();

for (int i : colors) {
result.add(r.getColor(i));
}

return result;
}

/**
/**
* Turns an array of colors (integer color values) into an ArrayList of colors.
*/
public static List<Integer> createColors(int[] colors) {
Expand Down
Loading