GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - azaitsev/foreground: Choose foreground of text color based on background color.

BranchesTags
Open more actions menu

Latest commit

 

History

3 Commits
3 Commits

Folders and files

NameName
Last commit message
Last commit date
foreground
foreground
 
 
.gitignore
.gitignore
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
example.png
example.png
 
 
setup.cfg
setup.cfg
 
 
setup.py
setup.py
 
 

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

color-schemeforegroundforeground-backgroundtext-colorweb-colors

Resources

Readme
MIT license
Activity

Stars

3 stars

Watchers

1 watching

Forks

0 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.