Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

foreground

Choose black or white foreground color of text based on background color to get better contrast. W3C compliant.

example

Installation

pip install foreground

Usage

Pass background color to get black or white foreground color

from foreground import get_foreground

get_foreground('#85C1E9')
# '#000000'

get_foreground('#85C1E9', output='RGB') # output as RGB tuple
# (0, 0, 0)

get_foreground((133, 193, 233)) # working with RGB
# '#000000'

get_foreground((133, 193, 233), output='RGB') # RGB input and output
# '#000000'

About

Choose foreground of text color based on background color.

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Used by

Contributors

Languages