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

About the color types #335

Closed
diego-c opened this issue Mar 11, 2018 · 4 comments
Closed

About the color types #335

diego-c opened this issue Mar 11, 2018 · 4 comments

Comments

@diego-c
Copy link

diego-c commented Mar 11, 2018

According to the documentation, taking the Border object as an example, it says:

  • border - Border object.
    • type - Type of border (line or bg). bg by default.
    • ch - Character to use if bg type, default is space.
    • bg, fg - Border foreground and background, must be numbers (-1 for
      default).
    • bold, underline - Border attributes.

And about the colors:

Colors

Colors can be the names of any of the 16 basic terminal colors, along with hex
values (e.g. #ff0000) for 256 color terminals. If 256 or 88 colors is not
supported. Blessed with reduce the color to whatever is available.

I understand that something like:

const border = {
    fg: 0,
    bg: 22
}

Could be similar to:

const border = {
    fg: 'black',
    bg: 'green'
}

But shouldn't it say that fg and bg could also be strings?

@ghost
Copy link

ghost commented Mar 11, 2018

Colors can be the names...

@diego-c
Copy link
Author

diego-c commented Mar 11, 2018

@hypersad Exactly, so why does the first quote for the Border object says bg and fg must be numbers?

I'm just curious, because in @types/blessed the same quote is referenced and bg and fg are also defined as numbers.

@ghost
Copy link

ghost commented Mar 11, 2018

Could it be outdated? Or, maybe there is some kind of internal converter.

@diego-c
Copy link
Author

diego-c commented Mar 11, 2018

Yep, looks like the colors are mapped and converted on lib/colors.js. Also referenced on #108.

Thanks for the response. I'll open a PR, though not sure if the project is still actively maintained.

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

No branches or pull requests

1 participant