adobe / leonardo

Generate colors based on a desired contrast ratio
http://www.leonardocolor.io
Apache License 2.0
1.97k stars 109 forks source link

added output format Theme.contrastColorPairs #132

Closed NateBaldwinDesign closed 3 years ago

NateBaldwinDesign commented 3 years ago

Description

This PR closes #131

Adds Theme.contrastColorPairs as a getter to return contrast color output in simplified format:

{
    background: '#e1e1e1',
    gray100:'#e0e0e0',
    gray200: '#cecece',
    gray300: '#bfbfbf',
    blue100: '#b28bff',
    blue200: '#8f62ff',
    blue300: '#6339ff',
    red100: '#ff7474',
    red200: '#ff1010',
    red300: '#cc0000'
  }

This PR includes two additional test to verify this output format; one for generated color names and another with user-defined color names.

Motivation

Flexibility of output formats in Leonardo to aid in transformation process of data when using color output as variables, such as CSS Properties (eg, --gray300: '#bfbfbf'

Screenshots

To-do list