Difference between revisions of "Color Inline Expressions"

From MSX - Wiki
Jump to navigation Jump to search
 
Line 1: Line 1:
It is possible to change the default color in a text with inline expressions. The expression <code>{col:{COLOR}}</code> sets the color and the expression <code>{col}</code> switches back to the default color. Please see [[Colors]] for possible color values. This feature is available since version '''0.1.91'''.  
+
It is possible to change the default color in a text with inline expressions. The expression <code>{col:{COLOR}}</code> sets the color and the expression <code>{col}</code> switches back to the default color. Please see [[Colors]] for possible values. This feature is available since version '''0.1.91'''.  
 
Please see following example.
 
Please see following example.
  

Latest revision as of 12:35, 18 January 2021

It is possible to change the default color in a text with inline expressions. The expression {col:{COLOR}} sets the color and the expression {col} switches back to the default color. Please see Colors for possible values. This feature is available since version 0.1.91. Please see following example.

Example[edit]

Screenshot[edit]

Example Screenshot (Color Inline Expressions)

Code[edit]

{
    "headline": "Color Inline Expressions",
    "pages": [{
            "items": [{
                    "layout": "0,0,12,6",
                    "color": "msx-glass",
                    "text": [
                        "{col:msx-red}This line is red.{br}",
                        "{col:msx-green}This line is green.{br}",
                        "{col:msx-yellow}This line is yellow.{br}",
                        "{col:msx-blue}This line is blue.{br}",
                        "{col}This line has the default color.{br}",
                        "{col:msx-red}This part is red, {col:msx-green}this part is green and contains a {txt:msx-yellow:yellow} word.{br}",
                        "{col:msx-blue}These icons are blue: ",
                        "{ico:favorite} {ico:check-circle} {ico:lock} {ico:flag}.{br}",
                        "This part is still blue and these icons have their own colors: ",
                        "{ico:msx-red:favorite} {ico:msx-green:check-circle} {ico:msx-yellow:lock} {ico:msx-blue:flag}.{br}",
                        "{col:default}The default color can also be set like this.{br}"
                    ]
                }]
        }]
}

Demo[edit]