Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve typescript return types #102

Open
wants to merge 86 commits into
base: main
Choose a base branch
from

Conversation

fedeci
Copy link
Contributor

@fedeci fedeci commented Sep 12, 2020

Description

Types returned from 'generateAdaptiveTheme' and 'fixColorValue' now are variable depending on a generic parameter.
eg.

// color will be of type 'string',
// while before it would have been of type 'string | { [key: string]: number }'
const color = fixColorValue('#2c66f1', 'HSL', false)

This closes #99

Motivation

This helps the user to better understand what the function will return.

Screenshots

To-do list

  • This pull request is ready to merge.

NateBaldwinDesign and others added 30 commits December 6, 2019 15:51
Merge branch 'master' of github.com:adobe/leonardo
style: fixed issue with tabs indicator color fallback
feat: adding link to demo app in UI
style: Updated demo app to a calendar with more colors to demonstrate
style: updated styles of links
…ize-to-js-3.0.2

build(deps): bump serialize-to-js from 3.0.0 to 3.0.2
style: dropdown width override to correct width
lazd and others added 21 commits May 4, 2020 14:10
Bumps [lodash](https://github.com/lodash/lodash) from 4.17.15 to 4.17.19.
- [Release notes](https://github.com/lodash/lodash/releases)
- [Commits](lodash/lodash@4.17.15...4.17.19)

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [elliptic](https://github.com/indutny/elliptic) from 6.5.1 to 6.5.3.
- [Release notes](https://github.com/indutny/elliptic/releases)
- [Commits](indutny/elliptic@v6.5.1...v6.5.3)

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* added  option for color scales in

* updated test for error

* updated to allow ratios input as an object
* Added color format output functionality to contrast-colors package

* readme update

* readme update
* feat: add Typescript support

* feat: update index.d.ts
* added contrast checker to Leonardo

* enhancements to checker

* fixed converter layout

* added conversion support for contrast inputs
* added linear interpolation to resolve alpha transparency for calculating contrast

* added missing commits
* fix: remove 'HEX' and 'CAM02p' from color spaces used to interpolate values

* feat: add 'NamedColorScale' interface
@fedeci fedeci changed the title Improve Typescript return types Improve typescript return types Sep 12, 2020
@GarthDB GarthDB force-pushed the main branch 8 times, most recently from 500acc1 to ed3e3c3 Compare March 15, 2024 18:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Typescript : add returned types of generateAdaptiveTheme function
7 participants