texlive[72010] Master/texmf-dist: context-chat (11aug24)

commits+karl at tug.org commits+karl at tug.org
Sun Aug 11 22:07:12 CEST 2024


Revision: 72010
          https://tug.org/svn/texlive?view=revision&revision=72010
Author:   karl
Date:     2024-08-11 22:07:12 +0200 (Sun, 11 Aug 2024)
Log Message:
-----------
context-chat (11aug24)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/context/third/chat/VERSION
    trunk/Master/texmf-dist/tex/context/third/chat/t-chat.mkiv

Modified: trunk/Master/texmf-dist/doc/context/third/chat/VERSION
===================================================================
--- trunk/Master/texmf-dist/doc/context/third/chat/VERSION	2024-08-10 23:44:56 UTC (rev 72009)
+++ trunk/Master/texmf-dist/doc/context/third/chat/VERSION	2024-08-11 20:07:12 UTC (rev 72010)
@@ -1 +1 @@
-2024.07.20
+2024-08-10

Modified: trunk/Master/texmf-dist/tex/context/third/chat/t-chat.mkiv
===================================================================
--- trunk/Master/texmf-dist/tex/context/third/chat/t-chat.mkiv	2024-08-10 23:44:56 UTC (rev 72009)
+++ trunk/Master/texmf-dist/tex/context/third/chat/t-chat.mkiv	2024-08-11 20:07:12 UTC (rev 72010)
@@ -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,7 +10,8 @@
 
 \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]
@@ -17,6 +18,16 @@
 \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,7 +137,7 @@
   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,
@@ -133,7 +144,7 @@
   location=left,
 ]
 
-% Send text (right-facing).
+%D Send text (right-facing).
 \defineoverlay[ChatSendOverlay][\uniqueMPgraphic{ChatBubble}]
 \defineframedtext[ChatSendFrame][ChatBubbleFrame][
   background=ChatSendOverlay,
@@ -140,8 +151,8 @@
   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}}{



More information about the tex-live-commits mailing list.