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

Add color themes properties #4

Open
TristanCacqueray opened this issue May 4, 2021 · 0 comments
Open

Add color themes properties #4

TristanCacqueray opened this issue May 4, 2021 · 0 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@TristanCacqueray
Copy link
Contributor

The goal of this issue is to enable the user to provide their own CSS values for the ones hard-coded here:

re-ansi/src/Ansi.re

Lines 37 to 56 in 6e07d47

// Convert a 4 bits color code to its css color: https://en.wikipedia.org/wiki/ANSI_escape_code#3-bit_and_4-bit
let fourBitColors = (code: int): option(string) =>
switch (code) {
| 00 => "black"->Some
| 01 => "red"->Some
| 02 => "green"->Some
| 03 => "yellow"->Some
| 04 => "blue"->Some
| 05 => "magenta"->Some
| 06 => "cyan"->Some
| 07 => "white"->Some
| 09 => "initial"->Some
| 10 => "grey"->Some
| 11 => "#DA2647"->Some
| 12 => "#87FF2A"->Some
| 13 => "#FFF700"->Some
| 14 => "#5DADEC"->Some
| 15 => "#FF3399"->Some
| 16 => "#8DD9CC"->Some
| 17 => "white"->Some
.

In particular, we need to enable the user to provide their own initial value for the code 9, as documented in #3

To do that, we could:

  • add an optional fourBitColors function property to the React component, or
  • define a color palete type property, and modify the existing fourBitColors function to use that instead.

When color themes is implemented, it might be good to also provide default themes, such as dark, light, and their solarized version.

@TristanCacqueray TristanCacqueray added enhancement New feature or request good first issue Good for newcomers labels May 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant