Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle color using attributes #57

Closed
wants to merge 60 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
d7c6c4b
Allocation of Lua functions (pseudoprimitives)
vlasakm Jun 22, 2021
c2b3d69
Handle color using attributes
vlasakm Jun 22, 2021
e3e46e8
test branch colors
olsak Jun 24, 2021
c34e9f9
add debug print
vlasakm Jun 24, 2021
8c40acd
Perform color setting in TeX
vlasakm Jun 27, 2021
750a557
Only set stroke color when necessary
vlasakm Jun 27, 2021
834d3e7
Add back support for \onlyrgb and \onlycmky
vlasakm Jun 27, 2021
e12b8c3
\onlyrgb, \onlycmyk corrected
olsak Jun 28, 2021
d26f6f9
branch marked in the banner
olsak Jun 28, 2021
3492b66
grouping in \table items changed
olsak Jun 29, 2021
83d211e
Define \preshipout and use callback
vlasakm Jun 29, 2021
36e0562
Simplify \incircle thanks to attributes
vlasakm Jun 29, 2021
3ac7e6d
Remove unnecessary grouping in \coloron
vlasakm Jun 26, 2021
306a467
Implement (no)localcolor in terms of \_colorprefix
vlasakm Jun 29, 2021
98f48a7
Save a few bytes in manually specified colors
vlasakm Jun 29, 2021
ab7003d
Fix typo
vlasakm Jun 29, 2021
ce57344
Prepare for luaotfload's color font feature
vlasakm Jun 29, 2021
fb457bb
Set luaotfload's current handler to use attributes
vlasakm Jun 29, 2021
324d1f8
documentation actualized
olsak Jun 30, 2021
ba74a8e
Remove unneeded local assignments, minor cleanup
vlasakm Jun 30, 2021
c6b9784
Use private variants of commands
vlasakm Jun 30, 2021
198c865
Add explanation of stroke color handling
vlasakm Jun 30, 2021
d4952b2
Improve luaotfload color handler
vlasakm Jun 30, 2021
d48c2d5
subsections in optex.lua added
olsak Jul 1, 2021
68c6ea3
colors.opm: shortening of documentation
olsak Jul 1, 2021
cfec5d7
Make "color change needed" calculation more robust
vlasakm Jul 1, 2021
1eb51b2
Don't care about the color of PDF literals
vlasakm Jul 1, 2021
a26c350
Trick 0004: annoying spaces removed
vlasakm Jul 1, 2021
9620813
Trick 0004: convert to new \_setcolor
vlasakm Jul 1, 2021
e81a2c6
Trick 0004: remove unnecessary grouping
vlasakm Jul 1, 2021
4a0e8c6
Trick 0004: use bp to prevent rounding
vlasakm Jul 1, 2021
7eea14e
Trick 0004: fix bugs
vlasakm Jul 1, 2021
cb1281b
Trick 0004: better safe than sorry (0.3bp overlap)
vlasakm Jul 1, 2021
44cd823
Fix example in tables.opm
vlasakm Jul 1, 2021
adc30e7
Fix mistake, small improvements
vlasakm Jul 1, 2021
a8e33d3
10pt is better in the \morecolors example
olsak Jul 2, 2021
5de705e
Remove debug print
vlasakm Jul 2, 2021
eb5bc02
Fix coloring of leader rules
vlasakm Jul 2, 2021
eb1b3f9
OpTeX trick 0063 added
olsak Jul 3, 2021
8365aa4
Trick 0063: use local, even if its only debugging
vlasakm Jul 3, 2021
f36feaa
Update documentation for `colorize`
vlasakm Jul 3, 2021
532b0c9
Finally handle discretionary nodes
vlasakm Jul 4, 2021
57e619a
Simplify `is_color_needed` a little bit
vlasakm Jul 4, 2021
d5c26a9
Spare a call to `colorize` for no replacement list
vlasakm Jul 4, 2021
23d94f9
Trick 0004: update documentation
vlasakm Jul 6, 2021
104f4c4
Fix OpTeX tricks info about colorstacks
vlasakm Jul 6, 2021
409c2d9
Add generic creator of pre-shipout injectors
vlasakm Jul 8, 2021
0314851
Add transparency pre-shipout injector
vlasakm Jul 8, 2021
bc6482b
Add font outline pre-shipout injector
vlasakm Jul 8, 2021
891dca1
Manage graphics states
vlasakm Jul 9, 2021
9137981
Use the new ExtGState management
vlasakm Jul 9, 2021
cb273c4
Use double colon for the color->attribute mapping
vlasakm Jul 11, 2021
0657980
Attempt to improve color documentation
vlasakm Jul 11, 2021
43bfbaa
Revert transparency etc. (to be an OpTeX trick)
vlasakm Jul 11, 2021
a9e64d8
Delete unneeded `node.subtype`
vlasakm Jul 11, 2021
befddab
Make `pdfliteral` available outside of `optex.lua`
vlasakm Jul 14, 2021
6fd6316
Fix luaotfload hook
vlasakm Jul 14, 2021
a336ff7
Add OpTeX trick 0064
vlasakm Jul 14, 2021
5019077
Don't ever reset color globally
vlasakm Jul 14, 2021
a00db07
Fix double colons yet again
vlasakm Jul 16, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Use double colon for the color->attribute mapping
This will be easier to read and would be required for other cases like
transparencies, so it is probably better to be consistent.
vlasakm committed Jul 11, 2021
commit cb273c4a8a59f1f4bad6a0132468b255f7376c1f
8 changes: 4 additions & 4 deletions optex/base/colors.opm
Original file line number Diff line number Diff line change
@@ -68,22 +68,22 @@
This work is done by the \`\_translatecolor` macro. The following mapping
macros are created:
\begtt \catcode`<=13
\_color:<data> <fill-op> ... expands to used <attribute-value>
\_color::<data> <fill-op> ... expands to used <attribute-value>
\_color:<attribute-value> ... expands to <data> <fill-op>
\_color-s:<attribute-value> ... expands to <data> <stroke-op>
\endtt
The \`\_resetcolor` un-sets the color attribute, it means that default
color (black) is used.
color (black) shall be used.
\_cod -----------------------------

\_newattribute \_colorattr
\_newcount \_colorcnt \_colorcnt=1 % allocations start at 1
\_protected\_def\_setcolor{\_colorprefix\_colorattr=\_translatecolor}
\_def\_resetcolor{\_colorprefix\_colorattr=-"7FFFFFFF }
\_def\_translatecolor#1#2#3{\_ifcsname _color:#1 #2\_endcsname\_lastnamedcs\_relax
\_def\_translatecolor#1#2#3{\_ifcsname _color::#1 #2\_endcsname\_lastnamedcs\_relax
\_else
\_colorcnt
\_sxdef{_color:#1 #2}{\_the\_colorcnt}%
\_sxdef{_color::#1 #2}{\_the\_colorcnt}%
\_sxdef{_color:\_the\_colorcnt}{#1 #2}%
\_sxdef{_color-s:\_the\_colorcnt}{#1 #3}%
\_incr \_colorcnt