Emily Shorts built in extension Glulx Text Effects. How to change style color back & forth?

Good Day Inform 7 Adventurers!

Forgive this potentially remedial question as I am excited and early in my Inform 7 explorations. But I have been banging my head against my code and can not find the answer at all!
What is the best way to change text color in Emily Short’s built-in extension Glulx Text Effects? (The built-in extension in the Inform 7 interpreter)

I realize you set up your styles, which you can naturally hardcode a color into - but how do I change that color say for a single word in a phrase not changing other style properties? I feel like this should be easy and I am definitely missing some simple thing!

It looks like previous versions sometimes talk about using hard coded g-red-style or a hex option - [#0000FF], but I can not seem to get an idea how to apply it and adjust color more on the fly.

Any guidance is greatly appreciated! <3

Here’s a quick written up example to show my inquire in a bit more detail -


Include Glulx Text Effects by Emily Short.

house is a room. 

letter is here.

Table of User Styles (continued)
style name	color	italic	relative size
all-styles	#0F0F00	false	--
italic-style	#0000FF" [ blue ]	true	--
fixed-letter-spacing-style	#444444" [ dark-grey ]	false	--

[not sure how to insert a different color into a style so forgive my red color? & default color? place holders]
instead of examining letter:
    say "[fixed letter spacing]I love you so much, but our growing dread of [red color?]blood[default color?] that forgot us has manifested.".

2 Likes

This is unfortunately not possible in Glulx. There’s a Gargoyle extension that makes it possible, but most interpreters don’t support it yet.

1 Like

A better solution for this might be to use Mathbrush’s Bisquixe and Simple Multimedia Effects for V10, which allow you to affect these elements using CSS directly from the Inform 7 code.

2 Likes

It’s supported in Gargoyle, Parchment, Spatterlight, and Windows Git/Glulxe now!

You can use the Glk Text Formatting extension to specify per-character colours.

It will also be built in to the next release of Inform, but don’t wait for that. Hopefully this year!

5 Likes