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

leonardocolor.io website's JS API documentation's updateColor definition to be updated to reflect correct theme.js capabilities #229

Closed
dorukde opened this issue Jan 18, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@dorukde
Copy link

dorukde commented Jan 18, 2024

Description

Leonardo JS API documentation explains the update function as
Theme.updateColor = {name, property}

`const red = new Color({...})
// Change the colors ratios
theme.updateColor = {name: 'red', ratios: [3, 4.5, 7]};

// Change the colors colorKeys
theme.updateColor = {name: 'red', colorKeys: ['#ff0000']};

// Change the color's name
theme.updateColor = {name: 'red', name: 'Crimson'};`

However, theme.js definition of updateColor uses color: "red" to filter (and to find) the color, and name:"blue" to change the name of the color.

Steps to reproduce

  1. Create a theme
  2. Update color & name of the new color in the theme theme.updateColor = {color: 'blue' name: 'red', colorKeys: ['#ff0000'] };
    `
    This will find the color with the name blue, and update its name & value at the same time. The documentation is not wrong, however I (and some other developers) found it confusing when filtering from an external function. I think extending the update definition may clarify. I found the definition at theme.js to be more helpful.

Expected behavior

The documentation should explain this capability. I think the theme.js should stay as is, as many projects are probably already consuming it. It makes more sense to update the documentation. There's a comment in theme.js which explains how this function should be used.

Screenshots

Leonardo package and version

leonardocolor.io website

Environment

MacOS

Additional context

@dorukde dorukde added the bug Something isn't working label Jan 18, 2024
GarthDB added a commit that referenced this issue Mar 25, 2024
GarthDB added a commit that referenced this issue Mar 25, 2024
GarthDB added a commit that referenced this issue Mar 25, 2024
@GarthDB GarthDB mentioned this issue Mar 25, 2024
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant