Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Take random colors in a preset color list. #58

Closed
samyhd opened this issue Jun 10, 2018 · 3 comments
Closed

Take random colors in a preset color list. #58

samyhd opened this issue Jun 10, 2018 · 3 comments

Comments

@samyhd
Copy link

samyhd commented Jun 10, 2018

Is it possible to set a topic that allows the items inside to take a random color in a preset color list, or it will look better than a simple color. And it will be more convenient to set up.

for example

`

public class ChartColorTemplate {

public static final Integer[] COMMON_COLORS = {
    rgb("#FF69B4"), rgb("#9370DB"), rgb("#6495ED"), rgb("#F08080"), rgb("#FF7F50"), rgb("#FF8C00"), rgb("#90EE90"), rgb("#40E0D0"), rgb("#00CED1"),
    rgb("#00BFFF"), rgb("#7B68EE"), rgb("#BA55D3"), rgb("#EE82EE"), rgb("#FF1493"), rgb("#FF69B4"), rgb("#20B2AA"), rgb("#00EE00"),
    rgb("#7D26CD"), rgb("#90EE90"), rgb("#CD3278"), rgb("#CD4F39"), rgb("#EEC591"), rgb("#FF3E96"), rgb("#FF6EB4"), rgb("#FFBBFF")
};

public static void addColors(ArrayList<Integer> colors, Integer... colorTemplate) {
    List<Integer> list = Arrays.asList(colorTemplate);
    Collections.shuffle(list);

    colors.addAll(list);
}

}

`

@robertlevonyan
Copy link
Owner

how do you want to use this with Chip?

@samyhd
Copy link
Author

samyhd commented Jun 12, 2018

I think I can quickly create a colorful list, rather than a single color, or I need each one to set up different colors. If it can be generated simply and randomly, that would be best.

@robertlevonyan
Copy link
Owner

No you have to set color manually to each Chip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants