Skip to content

Update cm-colors documentation with verified outputs and detailed usage explanations #1

@lalithaar

Description

@lalithaar

The documentation for cm-colors contains example code snippets with placeholder expected outputs. This can confuse new users. Please update the documentation as follows:

What needs to be done:

  • Fork and clone the cm-colors library.
  • Set up a virtual environment and install the library locally.
  • Run the code examples in the documentation and update the expected output values with the actual results you get.
  • Add or improve explanations to make the documentation more accessible and beginner-friendly.
  • If you encounter any errors in sample code, fix them as you go.
  • Open a draft pull request in comfort-mode-toolkit/docs and link it to this issue.

Reference (for updating and explaining examples):

  • The function CMColors.ensure_accessible_colors checks the contrast between text and background colors and, if necessary, adjusts the text color to meet WCAG AAA requirements (or AA for large text) with minimal perceptual change.
  • Returns: The (potentially adjusted) text RGB, background RGB, WCAG compliance level ("AAA", "AA", or "FAIL"), initial contrast ratio, and final contrast ratio.

Getting started:

git clone [your forked repo]
cd cm-colors
python3 -m venv env
source env/bin/activate
pip install -e .

You can import the library using from cm_colors import ....

Notes:

  • Make sure your updates are beginner-friendly.
  • This is a good first issue for new contributors!
  • For more details, you can refer to the @comfort-mode-toolkit/cm-colors repository.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Status

    documentation needed

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions