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

Function for creating adaptive palette/theme #34

Closed
NateBaldwinDesign opened this issue Jan 3, 2020 · 0 comments
Closed

Function for creating adaptive palette/theme #34

NateBaldwinDesign opened this issue Jan 3, 2020 · 0 comments
Assignees
Labels
enhancement New feature or request npm packages Issues related to the leonardo npm packages

Comments

@NateBaldwinDesign
Copy link
Collaborator

Description

Create a package that allows for simpler creation of a full contrast-based color palette.
("theme" or "palette" is undecided)

generateContrastTheme() as @adobe/leonardo-contrast-theme

Function would accept destructured parameters for base and palette. The base parameter will accept an object containing the parameters for the generateBaseScale function. The palette parameter will be an array of objects, each containing the parameters for each generateContrastColors function.

// pseudo-code concept
generateContrastTheme({
   base: {},
   palette: []
}) {
   b = generateBaseScale(base)[]; // base parameter to create base scale (0-100)
   for (I=0; i < palette.length; i ++) {
       return generateContrastColors(i, b);
   }
}

Usage:

let myTheme = generateContrastTheme( */ parameters /* );
let lightTheme = myTheme(100);  // returns white theme all colors
let darkTheme = myTheme(0);  // returns white theme all colors

Steps to reproduce

Expected behavior

Screenshots

Environment

  • @leonardo-contrast-colors version:
  • Browser(s) and OS(s):

Additional context

@NateBaldwinDesign NateBaldwinDesign added bug Something isn't working npm packages Issues related to the leonardo npm packages enhancement New feature or request and removed bug Something isn't working labels Jan 3, 2020
@NateBaldwinDesign NateBaldwinDesign changed the title New package for creating adaptive palette/theme Function for creating adaptive palette/theme Jan 4, 2020
@NateBaldwinDesign NateBaldwinDesign self-assigned this Jan 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request npm packages Issues related to the leonardo npm packages
Projects
None yet
Development

No branches or pull requests

1 participant