summaryrefslogtreecommitdiff
path: root/Master/texmf-dist
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2024-08-11 20:07:12 +0000
committerKarl Berry <karl@freefriends.org>2024-08-11 20:07:12 +0000
commit1369f564f8fae0d5088ffa6784eb903a7b68caee (patch)
tree50ba40d0763f36c5995ad09bb0fa5874a919c42c /Master/texmf-dist
parent08399ede1e5bd5ce21a996ad3a9205722b05d289 (diff)
context-chat (11aug24)
git-svn-id: svn://tug.org/texlive/trunk@72010 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist')
-rw-r--r--Master/texmf-dist/doc/context/third/chat/VERSION2
-rw-r--r--Master/texmf-dist/tex/context/third/chat/t-chat.mkiv33
2 files changed, 23 insertions, 12 deletions
diff --git a/Master/texmf-dist/doc/context/third/chat/VERSION b/Master/texmf-dist/doc/context/third/chat/VERSION
index 50af9173a9f..72ccc5e1b68 100644
--- a/Master/texmf-dist/doc/context/third/chat/VERSION
+++ b/Master/texmf-dist/doc/context/third/chat/VERSION
@@ -1 +1 @@
-2024.07.20
+2024-08-10
diff --git a/Master/texmf-dist/tex/context/third/chat/t-chat.mkiv b/Master/texmf-dist/tex/context/third/chat/t-chat.mkiv
index 75a8acaa269..b3e1933549e 100644
--- a/Master/texmf-dist/tex/context/third/chat/t-chat.mkiv
+++ b/Master/texmf-dist/tex/context/third/chat/t-chat.mkiv
@@ -1,6 +1,6 @@
%D \module
%D [ file=t-chat,
-%D version=2024.07.20,
+%D version=2024.08.10,
%D title=\CONTEXT\ User Module,
%D subtitle=Chat,
%D author=Henning Hraban Ramm,
@@ -10,13 +10,24 @@
\unprotect
-% TODO: color palet
+%D First we define a few colors.
+%D Don’t rely on these names, use the “Chat” palet instead.
\definecolor[ChatColorI][c=0,m=.03,y=.15,k=0]
\definecolor[ChatColorII][c=.1,m=0,y=0,k=0]
\definecolor[ChatNameColor][c=0,m=0,y=0,k=.1]
\definecolor[ChatColor][ChatColorI]
\definecolor[ChatFrameColor][ChatNameColor]
+%D The palet contains all used colors.
+%D ATM there are only 2 different colors for recipient and sender,
+%D there should be more colors to distinguish senders.
+\definepalet[Chat][
+ frame=ChatFrameColor,
+ name=ChatNameColor,
+ 1=ChatColorI,
+ 2=ChatColorII,
+]
+
\installcorenamespace {chat}
\installsimplecommandhandler \??chat {Chat} \??chat
@@ -41,10 +52,10 @@
if "\getvariable{Chat}{Person}" = "\Chatparameter{recipient}" :
side := 0;
- bgcol := "ChatColorI";
+ bgcol := "Chat:1";
; else :
side := 1;
- bgcol := "ChatColorII";
+ bgcol := "Chat:2";
; fi ;
if "\getvariable{Chat}{Person}" = "\getvariable{Chat}{PrevPerson}" :
@@ -108,7 +119,7 @@
fi;
fill p withcolor bgcol ;
- draw p withpen pencircle scaled 0.75 withcolor "ChatFrameColor";
+ draw p withpen pencircle scaled 0.75 withcolor "Chat:frame";
setbounds currentpicture to OverlayBox ;
\stopuniqueMPgraphic
@@ -126,22 +137,22 @@
after={\vskip\dimexpr-\Chatparameter\c!distance\relax},
]
-% Receive text (left-facing).
+%D Receive text (left-facing).
\defineoverlay[ChatGetOverlay][\uniqueMPgraphic{ChatBubble}]
\defineframedtext[ChatGetFrame][ChatBubbleFrame][
background=ChatGetOverlay,
location=left,
]
-% Send text (right-facing).
+%D Send text (right-facing).
\defineoverlay[ChatSendOverlay][\uniqueMPgraphic{ChatBubble}]
\defineframedtext[ChatSendFrame][ChatBubbleFrame][
background=ChatSendOverlay,
location=right,
]
-% This should become an avatar
-% or simply initials in a circle
+%D This should become an avatar
+%D or simply initials in a circle
\defineframed[ChatSenderFramed][
width=1em,
offset=overlay,
@@ -153,10 +164,10 @@
%corner=rounded,
%frameradius=.5em,
%background=color,
- %backgroundcolor=ChatFrameColor,
+ %backgroundcolor=Chat:frame,
]
-% Only show names (avatars) if person is different from last one
+%D Only show names (avatars) if person is different from last one
% Sender name: #1 x-offset
\define[1]\ChatSender{\offset[x=#1]{%
\doifnot{\getvariable{Chat}{Person}}{\getvariable{Chat}{PrevPerson}}{