[REBOL] Re: colored text
From: mario:cassani:icl at: 19-Nov-2001 16:51
Hallo Cyphre,
> The color-text VID style uses very simple dialect like:
>
> view layout [
> color-text ["Hello" red "World" eol bold blue "This is"
> normal yellow
> "next" italic "line."] wrap
> ]
could you (or someone listening and interested) please help
me writing a short example showing how to colorise the below
example only (at the bottom)?
> so there is no problem to parse any format and build the
> dialect block for
> your needs.
I need a sample dialect able to distinguish between the
below samples that are difficult because I cannot know how deep
the quote goes...
My dummy (and inefficient) approach would be something
like (untested):
; *** Botton example is this ***
;
; > > Something has color2
; > Something has color1
; Something has standard color
;
either parse mail-string ["> > > " copy unquoted-string to end] [
colored-string: [red "> > > " orange unquoted-string]
] [
either parse mail-string ["> > " copy unquoted-string to end] [
colored-string: [blue "> > " cyan unquoted-string]
] [
either parse mail-string ["> " copy unquoted-string to end] [
colored-string: [brown "> " yellow unquoted-string]
] [
colored-string: [mail-string]
]
]
]
Thank you
Mario