Skip to content
This repository has been archived by the owner on Oct 22, 2021. It is now read-only.

Make terminal colored again! #483

Closed
2 of 8 tasks
bdotsamir opened this issue Apr 18, 2019 · 6 comments
Closed
2 of 8 tasks

Make terminal colored again! #483

bdotsamir opened this issue Apr 18, 2019 · 6 comments
Assignees

Comments

@bdotsamir
Copy link

bdotsamir commented Apr 18, 2019

Perceived idea awesomeness

  • Wow, you don't have this yet???
  • Would be super cool.
  • I'm not sure a lot of people would use it, but I'd love to have it.
  • Kind of a gadget, honestly, but why not?

Perceived idea difficulty

  • Quit your job first.
  • Would need some work, but nothing impossible.
  • Shouldn't be too hard to make.
  • Like, I could do it (Possibly, I haven't messed with classes yet, and I haven't entirely nailed down the concept of modules yet.)

Similar to #463 but not really? I was snooping through the code to see how ya dun it and I noticed, in src/classes/terminal.class.js, you've grayscaled the colors. I removed the grayscale method and was still muted a little bit, so I messed with the number in the mix method. Changed it to 1 and everything was black and white; no in-between like you had before. I changed it to 0.7 and it was slightly more muted than 0.3.. the default.
This sparked an idea.
Why not make that grayscale-ness customizable to the user? And I don't just mean in themes and such, I mean like as a setting or something.

A concept for the setting itself

.grayscale() removed, setting at 0% colorified, actual value in code is 1.

.grayscale() removed, setting at 40% colorified, actual value in code is 0.6

... and so on and so forth.

Lmk what you think

@Xeddius
Copy link

Xeddius commented Apr 18, 2019

This could definitely be useful for more colorful themes in the future, perhaps options to dynamically color themes can be added as well? (Like a slow color change/fade!) different colors per module would also be neat.

@GitSquared
Copy link
Owner

So far every visual setting and tweak is handled by themes (except font size, because it's something that you want to be able to change on-the-fly); I don't want to break that rule so eventual terminal color filters would have to be defined in a theme file.
I'm thinking about how we could use JSON strings to represent a full chain of color functions, for even more awesome customization.

And @Xeddius - different colors per module will have to wait for #334.

@bdotsamir
Copy link
Author

That would be interesting, what would that look like?

@GitSquared
Copy link
Owner

@jennasisis Something like this:

{
  "terminal":
    "colorFilter": [
      "saturate(120)",
      "hue(340)",
      "mix(0.3)"
    ],
    "colorFilterMixTarget": "#00FF00"
  }
}

@bdotsamir
Copy link
Author

Oh that’s interesting, I’ll see if I can work that in and open a PR when I have the time.

@GitSquared
Copy link
Owner

GitSquared commented Apr 29, 2019

Implemented. I'm going to write some docs on this and push it to master.

edit: docs are up.

Here are some examples, shown side-by-side with another terminal so you spot the color difference:

        "colorFilter": [
            "negate()"
        ]

image


        "colorFilter": [
            "rotate(180)",
            "saturate(0.5)",
            "mix(0.7)"
        ]

image


        "colorFilter": [
            "rotate(-40)",
            "desaturate(0.2)",
            "mix(0.4)"
        ]

image


This is surely the most gadget feature I've ever made, lol. But it's 20 lines of code and you can probably get something good out of it, so why not?

I made all the necessary stuff to prevent abusing this for code injection, too. That's actually 99% of the commit, so I thought I'd mention it.

I'm going to include a new tron-colorfilter showcase theme, and I'll link the docs here once I'll be done with that.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants