ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Hatch color in a table cell
@ 2020-03-12 16:40 Fabrice Couvreur
  0 siblings, 0 replies; only message in thread
From: Fabrice Couvreur @ 2020-03-12 16:40 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 2490 bytes --]

Hi,
I would like to hatch the cell green.
Thank you.
Fabrice

\usecolors[xwi]
\startuniqueMPgraphic{meta:hash}{linewidth,linecolor,angle,gap}
if unknown context_back : input mp-back ; fi ;
some_hash ( OverlayWidth, OverlayHeight ,
\MPvar{linewidth}, \MPvar{linecolor} ,
\MPvar{angle}, \MPvar{gap} ) ;
\stopuniqueMPgraphic

\setupMPvariables
[meta:hash]
[gap=.25\bodyfontsize,
angle=45,
linewidth=\overlaylinewidth,
linecolor=\overlaylinecolor]

\def\metahashoverlay#1{\uniqueMPgraphic{meta:hash}{angle=#1}}
\defineoverlay[meta:hash:right]
[\metahashoverlay{ +45}]
\defineoverlay[meta:hash:left]
[\metahashoverlay{ -45}]
\defineoverlay[meta:hash:horizontal][\metahashoverlay{+180}]
\defineoverlay[meta:hash:vertical] [\metahashoverlay{ -90}]
\starttext
  \startmidaligned
                \startxtable
                  [align={lohi,middle}, width=1.5cm, background=color,
                    backgroundcolor=white, framecolor=purple,
                    meta:hash:linecolor=green]
                  \startxrow

\startxcell[background=color,backgroundcolor=paleturquoise]
                      i
                    \stopxcell
                    \startxcell[background=meta:hash:right,frame=off]

                    \stopxcell
                    \startxcell
                      0
                    \stopxcell
                    \startxcell
                      1
                    \stopxcell
                    \startxcell
                      2
                    \stopxcell
                  \stopxrow
                  \startxrow

\startxcell[background=color,backgroundcolor=paleturquoise]
                      S
                    \stopxcell
                    \startxcell
                      0
                    \stopxcell
                    \startxcell

                    \stopxcell
                    \startxcell

                    \stopxcell
                    \startxcell

                    \stopxcell
                  \stopxrow
                  \startxrow

\startxcell[background=color,backgroundcolor=paleturquoise]
                      a
                    \stopxcell
                    \startxcell
                      3
                    \stopxcell
                    \startxcell

                    \stopxcell
                    \startxcell

                    \stopxcell
                    \startxcell

                    \stopxcell
                    \stopxrow
                \stopxtable
              \stopmidaligned
\stoptext

[-- Attachment #1.2: Type: text/html, Size: 4177 bytes --]

[-- Attachment #2: Type: text/plain, Size: 493 bytes --]

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-03-12 16:40 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-12 16:40 Hatch color in a table cell Fabrice Couvreur

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).