-M: 256color stream-format
- [
- [ foreground of [ color>foreground ] [ "" ] if* ]
- [ background of [ color>background ] [ "" ] if* ]
- [ font-style of [ font-styles ] [ "" ] if* ]
- tri 3append [ "\e[0m" surround ] unless-empty
- ] dip stream>> stream-write ;
+M:: 256color stream-format ( str style stream -- )
+ stream stream>> :> out
+ style foreground of [ color>foreground out stream-write t ] [ f ] if*
+ style background of [ color>background out stream-write t ] [ f ] if*
+ style font-style of [ font-styles out stream-write t ] [ f ] if*
+ or or [ "\e[0m" out stream-write ] unless
+ str out stream-write ;