adobe / adobe/leonardo

Change the contrast between two colors to the target value in NPM

Open
#148 1 comment 0 reactions 0 assignees View on GitHub
enhancement npm packages
Dominant language
JavaScript
Stars
2.1k
Forks
130
PR merge metrics
No merged PRs in 30d

Description

## Description
Colleagues, I need your help. It seems to me that I have a very simple task that I can easily solve in the web interface of Leonardo, but I can not solve through the package.

My task. I have text color. I have a background color that I want to edit in such a way as to achieve a certain contrast between the background color and the text.

And I can do it elementarily on Leonardo's website, here's an example - https://leonardocolor.io/?colorKeys=%230362fc&base=151b1e&ratios=7&mode=HSL.

How do I get a package to do the same? Working with themes and the required lightness parameter make this impossible.

Please help me. And I am sure that such a simple method of IPA is simply necessary.

## Why do you need this feature?
Judging by the number of topics and questions on SOF, this is what people really need. Few people need adaptive themes, but automatically paint the background of the block - thousands of people face such a task.

## Leonardo package and version
Last.

Contributor guide

Open the contributing guide

Research direction

Start by reviewing the package API and the Leonardo example URL to identify how the web interface adjusts a background color to reach a requested contrast ratio. The work is done when the package exposes an equivalent operation for a text/background pair and its result reaches the requested contrast target.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
accessibility, design, frontend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.