Text color behaviour

So here I change the text color to Black, but the text still remains white. What am I doing wrong?

Screenshot 2022-01-27 at 8.17.15 AM

Check the Document Settings (⌘+8), Text tab. The normal default, as shown in the linked page, is ‘black’ (i.e. #000000). Some colour schemes—also in Document Settings (Colors tab) change the RGB value of named colours. Check that ‘black’ hasn’t been set to some other colour. If you switch between OS dark and light modes I recall some of the colour changes occasionally get out of synch. FWIW, the app knowing the ‘right’ colour after OS mode change is more complex that it appears.

Lastly, in the affected notes, select all existing $Text and via the Format ▸ Style sub-menu apply ‘Standard Font’ and the ‘Reset Margins’ to reset the text area to defaults.

1 Like

I would add that once you add text into the $text area it retains the colour (style) at the time of entry. Changing the $TextColor of the note does not affect existing text, and new text will continue to use the old colour. If you wish to apply a revised $TextColor to the note you need to use the Format ▸ Style menu as described above. Note also that using Standard font will remove all other styling (bold/italic/size, etc.) as well as the colour.

If still stuck, it would help to know how you came to need the colour change, i.e. what experiment with styling you were doing before-hand.

1 Like

is there a way to change the color of existing text with action code? I struggled in the same manner as Manoj - interpreting the $TextColor as an individual attribute of the note - I don’t think the current behaviour of TBX is consistent here. Setting the $TextColor attribute of an individual note should override the document setting - shouldn’t it?

In theory: yes, with the likes of StyledString.bold. The code works, but the affordances to select the correct piece of text and to close the syle off at the end of the insertion, etc., are still work-in-progress.

Document level

Doc Settings sets the default $Text font face ($TextFont), font size ($TextSize), and text colour ($TextColor) are all set as document defaults for the current document

Note level

All notes inherit those attributes (we’ll now focus on colour). If $TextColor is changed before any content is added to text the locally set custom colour is used for all text added.

If $TextColor is changed after text has been added, it has no effect. Being an RTF space, the existing rich text is already styled (i.e. the style as it was when entered) so the new value can’t apply. Consider, does the colour affect all existing test? Only non-bolded/italicised text? What about highlighted sections of text? And so on, in our mind we ‘see’ the desired outcome but it’s not so obvious from the code poit of view.

An Alternative approach

The new highligher feature (as distinct from highlighted text) shows that some of what you want may be possible in due course.


It might help to see a screen grab of the sort of text you are trying to change, so we can see the range of styling at play.

I’ll confess this sort of problem was why, when changes for the new v6 redesign were being discussed I was in the camp against making $Text more word-processor-like (to avoid needless over-complication) as opposed to a simple RTF space. That view lost out with the resulting muddle we now have.

†. The contention being that Tinderbox is a note-taking app and not a Word-processor. There are any number of tools that do that task with much more finesse. The problem of trying to cram large feature sets in just for tangential use is you get the sort of problems as above.

The current rules are really quite simple:

  1. If there is no text, then newly-added text will take on the characteristics of $TextColor, $TextFont, and so forth.

  2. If there is text, Tinderbox assumes that you set its styles the way you want them, and doesn’t change them — even if you later change $TextColor or $TextFont.

Would it be possible to change existing text by reading the content of $Text into (say) $MyText, delete it from $Text, alter $TextColor and $TextFont, and then put the text from $MyText into $Text? That might be a way to achieve what the OP wanted…

It’s certainly possible, though you’d lose bold for emphasis, italics for foreign terms and titles, and so forth.

Select All and Format ▸ Standard Font will do this manually as well; each has a handy shortcut.

Strings are plain text. $Text is the outlier in being styled. So, a String can’t hold styled $Text.

The problem with rules #1 and #2 is user’s consistently don’t understand that. If the user changes some aspect of the $Text font (colour/size/etc.), it is repeatedly clear they expect—albeit without explaining how the app would know—to change the correct parts of $Text to the new values.

If the existing Text is all in the same style, then the latter seems easy. But in reality, the $Text may be using different fonts, font faces (for bold/italic), have size differences, colour difference, highlighted (background) sections. If so, what changes and what doesn’t?

I can’t escape the notion that what user’s want/expect to happen is a change to $TextFont/Color/Size changes that aspect for all of current $Text. In most simple cases this will work nicely. Of course if the note has sections of $Text with a non-default colour applied and $TextColor were to be changed, in this imagined usage, all text changes colour. To do otherwise, Tinderbox would need to know the previous (and now overwritten) ‘base’ colour/size/etc. Despite that edge case it seems a far more understandable case that a change to $TextColor having no effect at all as that that definitely is not the user’s intent (if it doesn’t work, why allow the change?).

Yeah, I think many users - def this one - naturally think that setting text attributes at note level would be basically the same as select all > format > font/color etc…

1 Like

Thanks for the tip. My issues with changing text colors occurred when I was copy and pasting notes out of an old Tinderbox file (that has a white background and black text) into my new document with a dark background and white text. Using the apply standard font fixed my problems.