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

[Feat] Add JSON output to r.colors.out #3537

Open
petrasovaa opened this issue Mar 27, 2024 · 1 comment
Open

[Feat] Add JSON output to r.colors.out #3537

petrasovaa opened this issue Mar 27, 2024 · 1 comment
Labels
enhancement New feature or request gsoc Reserved for Google Summer of Code student(s)

Comments

@petrasovaa
Copy link
Contributor

Add JSON output for easy parsing of r.colors.out output.

Describe the solution you'd like
Adding option format, it would be something like format=plain for the current output format and format=json for the JSON output. There is a newly added parson library to GRASS (#3028), so it should be used here.

See also discussion in #3019.

A test should be included.
A possible JSON layout could be:

[
  {
    "value": 0,
    "red": 255,
    "green": 0,
    "blue": 0
  },
  {
    "value": 1,
    "red": 0,
    "green": 255,
    "blue": 0
  },
  {
    "value": 2,
    "red": 0,
    "green": 0,
    "blue": 255
  }
]
@petrasovaa petrasovaa added enhancement New feature or request gsoc Reserved for Google Summer of Code student(s) labels Mar 27, 2024
@cwhite911
Copy link
Contributor

It might be nice to have the output in a usable formats.

[
 {
    "value": 0,
    "hex": "#FF0000",
    "rgb": "rgb(255, 0, 0)",
    "rgb": "rgb(255, 0, 0, 0)",
    "hsl":  "hsl(0, 100, 50)"
  }
]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request gsoc Reserved for Google Summer of Code student(s)
Projects
None yet
Development

No branches or pull requests

2 participants