Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
ApplyColor method for a tutorial on the SSaurel's Blog
private void applyColor(String hexaTime) {
int color = Color.parseColor(hexaTime);
// white or black color for the text view
int tmp = (int) (0.2126 * + (int) (0.7152 * + (int) (0.0722 *;
timeTv.setTextColor(tmp < 128 ? Color.WHITE : Color.BLACK);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.