Skip to content

Commit

Permalink
group-pm: Improve the text color on group icons
Browse files Browse the repository at this point in the history
Determine the color of text on group avatar by using
foregroundColorFromBackground(). This will help users to
read the text properly when the background color is light.
  • Loading branch information
Maskedman99 authored and rk-for-zulip committed Mar 20, 2020
1 parent 0f7a809 commit 658003e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/common/GroupAvatar.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { Text, StyleSheet, View } from 'react-native';

import type { Node as React$Node } from 'react';
import Touchable from './Touchable';
import { colorHashFromString } from '../utils/color';
import { colorHashFromString, foregroundColorFromBackground } from '../utils/color';
import { initialsFromString } from '../utils/misc';

const styles = StyleSheet.create({
Expand Down Expand Up @@ -52,6 +52,7 @@ export default class GroupAvatar extends PureComponent<Props> {
};
const textSize = {
fontSize: size / 3,
color: foregroundColorFromBackground(frameSize.backgroundColor),
};

return (
Expand Down

0 comments on commit 658003e

Please sign in to comment.