-- Leo's gemini proxy

-- Connecting to skyjake.fi:1965...

-- Connected

-- Sending request

-- Meta line: 20 text/gemini;charset=utf-8;lang=en

Colors in Lagrange (Re: stack: ANSI Colors? / charick's review)


There were a few posts recently that touched on colors in Lagrange:


stack: ANSI colors? Just Say Yes!

charick: Internalized Elitism & Lagrange


ANSI escapes and color


I have a few recommendations on the appropriate use of color escapes in gemtext.


Most importantly, please consider that color escapes are not universally supported, so first do a version of your content that works without them. Unicode has plenty of expressiveness without color.


When it comes to Lagrange:


If you only use FG colors, they will be automatically adjusted to be readable regardless of the theme background color. In some themes, this greatly influences the actual color of the text (e.g., check the Sepia theme in AstroBotany).

If you use BG colors, *always* also set the FG color. Text color depends on the content coloring and OS light/dark mode, so you can't otherwise be certain that the foreground is visible.

There is no concept of a cursor that moves across the terminal to print the page, so any escapes that control the cursor are meaningless and ignored.

All attributes set via ANSI escapes are reset at the end of each text line. This is again because of the lack of a cursor that would carry over to the next line. You will need to set the FG/BG color for each line separately. For good measure, also reset the attributes with `<ESC>[0m` at the end of each line.


Customizing theme colors


Generally speaking, colors are a very subjective topic, so you probably aren't surprised to hear that a few people have requested the ability to customize the colors of some capsule. It's just random chance whether your own capsule gets a theme that you happen to like.


A few versions ago I added a way to store arbitrary site-specific settings in the sitespec.ini file. The plan is to add a setting there for a custom "theme seed" for a capsule. This will control the color palette that will be generated. So rest assured, you'll have a way to personalize chosen capsules to your liking without inflicting your specific color choices on others.


skyjake

📅 2022-01-30

🏷 Lagrange

CC-BY-SA 4.0


skyjake's Gemlog

-- Response ended

-- Page fetched on Tue May 7 10:51:25 2024