8000 Is there a way to detect the current color theme? · Issue #266 · ajalt/mordant · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Is there a way to detect the current color theme? #266
Open
@joffrey-bion

Description

@joffrey-bion

I'm trying to make inline code elements in markdown (the ones surrounded with backticks) look nice in Clikt help.

The default colors in Clikt for this markdown element type are the default blue highlight over a middle gray background, which has a low contrast and doesn't look very nice:

Image
Image

I tried to use some white-over-gray colors like this:

styles["markdown.code.span"] = styles["markdown.code.span"] + (TextColors.white on TextColors.rgb("#32373e"))

It looks slightly nicer in dark-themed terminals:
Image

But this is quite bad for light themes (the background is too dark, so too eye-catchy):
Image

I would like to adjust the colors depending on what the theme of the current terminal is. But I wonder if this is even possible. Is there any way to know what the default foreground/background colors are?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0