Sage
Welcome to Sage
Volume (51%) Hide Volume
Topics
Colors
Sage includes support for foreground and background colors. For example, you might want to use red text for a strong warning:

[red]*Caution:*[end] this feature has not been tested yet!

The above produces…


Caution:
this feature has not been tested yet!


Theme Colors

Sage offers ten theme-specific colors, which change based on the user's theme…
  • black
  • gray
  • white
  • red
  • orange
  • brown
  • yellow
  • green
  • blue
  • purple

Each of the above is available as a Sage tag, for controlling the text color…

[b][tt][pre] [black]black[end] [gray]gray[end] [white]white[end] [red]red[end] [orange]orange[end] [brown]brown[end] [yellow]yellow[end] [green]green[end] [blue]blue[end] [purple]purple[end] [end][end][end]

The above produces…


black
gray
white
red
orange
brown
yellow
green
blue
purple


Generally, any of these colors is readable as a foreground color against the theme's background. However, in the light theme, white doesn't contrast very well with the background.

Foreground and Background Colors

The [color] tag allows you to control either or both of the foreground and background colors, using the fg and bg attributes…

This text is [color fg=white bg=orange]white on orange[end][br] This text is [color fg=brown bg=black]brown on black[end][br] This text is [color fg=yellow bg=blue]yellow on blue[end][br]

The above produces…


This text is
white on orange

This text is
brown on black

This text is
yellow on blue


You can omit the attributes, and specify only a foreground color…

This is [color orange]orange text[end][br] This is [color blue]blue text[end][br] This is [color purple]purple text[end][br]

The above produces…


This is
orange text

This is
blue text

This is
purple text


Web Colors

The [color] tag also supports Web colors, which are not theme-sensitive. To use a web color, simply include a pound sign…

This is [color #orange]orange text[end][br] This is [color #blue]blue text[end][br] This is [color #purple]purple text[end][br] This is [color #salmon]salmon text[end][br] This is [color #39E]#39E text[end][br] This is [color #DF3291]#DF3291 text[end][br]

The above produces…


This is
orange text

This is
blue text

This is
purple text

This is
salmon text

This is
#39E text

This is
#DF3291 text


As the above example shows, you can use any web color, by name or numerically.

Note

When using colors, especially Web colors, remember to check how your article looks in both themes!


Flag

 * * * * * * 
   * * * * *
 * * * * * * 
   * * * * *
 * * * * * * 
   * * * * *
 * * * * * * 
   * * * * *
 * * * * * * 

Last Modified: 7/19 1:08:04 pm
In this article (top)  View article's Sage markup
7/19 1:08:04 pm