diff options
author | Karl Berry <karl@freefriends.org> | 2021-04-11 21:12:21 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2021-04-11 21:12:21 +0000 |
commit | 94b8c4659dc34d950029b202feeb55341439a7c8 (patch) | |
tree | aa0fdf2a39df9569f13b60fcdcd185eeb814b82b /Master/texmf-dist | |
parent | 1d2e2ac9a87fc3f31456f44714e1f6afd2945b6d (diff) |
ninecolors (11apr21)
git-svn-id: svn://tug.org/texlive/trunk@58833 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist')
-rw-r--r-- | Master/texmf-dist/doc/latex/ninecolors/README | 4 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/ninecolors/ninecolors.pdf | bin | 0 -> 14750 bytes | |||
-rw-r--r-- | Master/texmf-dist/doc/latex/ninecolors/ninecolors.tex | 89 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/ninecolors/ninecolors.sty | 143 |
4 files changed, 236 insertions, 0 deletions
diff --git a/Master/texmf-dist/doc/latex/ninecolors/README b/Master/texmf-dist/doc/latex/ninecolors/README new file mode 100644 index 00000000000..94934f0087e --- /dev/null +++ b/Master/texmf-dist/doc/latex/ninecolors/README @@ -0,0 +1,4 @@ +Ninecolors: Select colors with proper WCAG color contrast +Author : Jianrui Lyu <tolvjr@163.com> +Repository: https://github.com/lvjr/ninecolors +License : The LaTeX Project Public License 1.3 diff --git a/Master/texmf-dist/doc/latex/ninecolors/ninecolors.pdf b/Master/texmf-dist/doc/latex/ninecolors/ninecolors.pdf Binary files differnew file mode 100644 index 00000000000..7876eaf2ac8 --- /dev/null +++ b/Master/texmf-dist/doc/latex/ninecolors/ninecolors.pdf diff --git a/Master/texmf-dist/doc/latex/ninecolors/ninecolors.tex b/Master/texmf-dist/doc/latex/ninecolors/ninecolors.tex new file mode 100644 index 00000000000..cdda3624bdc --- /dev/null +++ b/Master/texmf-dist/doc/latex/ninecolors/ninecolors.tex @@ -0,0 +1,89 @@ +% -*- coding: utf-8 -*- +\documentclass{article} +\usepackage[a4paper,margin=1.5cm]{geometry} + +\usepackage{ninecolors} +\usepackage{arev} +\usepackage{pgffor} +\usepackage{hyperref} +\hypersetup{ + colorlinks=true, + urlcolor=blue3, +} + +\newcommand*{\myversion}{2021A} +\newcommand*{\mydate}{\the\year/\mylpad\month/\mylpad\day\ (v\myversion)} +\newcommand*{\mylpad}[1]{\ifnum#1<10 0\the#1\else\the#1\fi} + +\begin{document} + +\title{\href{https://github.com/lvjr/ninecolors}{Ninecolors: select colors with proper WCAG color contrast}} +\author{Jianrui Lyu (tolvjr@163.com)} +\date{\mydate} +\maketitle + +\textcolor{red4}{Ninecolors} package carefully selects and defines 9 colors for 13 hues each. +All colors with the same suffix number have equal luminance level. +Also color black is of level 0, and color white is of level 10. + +\bigskip + +\foreach \l in {1,...,9} +{ + \noindent + \foreach \n in {gray,red,brown,yellow,olive,green,teal,cyan,azure,blue,violet,magenta,purple} + {% + \xdef\mycolor{\ifnum \l < 5 white\else black\fi}% + \colorbox{\n\l}{\color{\mycolor}\texttt\strut\n\l}% + } + \par +} + +\bigskip + +\foreach \l in {1,...,9} +{ + \noindent + \foreach \n in {gray,red,brown,yellow,olive,green,teal,cyan,azure,blue,violet,magenta,purple} + {% + \xdef\mycolor{\ifnum \l < 5 gray9\else black\fi}% + \colorbox{\mycolor}{\color{\n\l}\texttt\strut\n\l}% + } + \par +} + +\bigskip +\hrule +\bigskip + +By simply choosing two colors in the above list, which differ in level by at least 5, +as foreground and background colors, you will get proper +\href{https://www.w3.org/WAI/WCAG21/Understanding/contrast-minimum.html}{WCAG Color Contrast}. + +\bigskip + +\colorbox{blue9}{% + \strut\color{green3}The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. +} +\par\nointerlineskip +\colorbox{green3}{% + \strut\color{blue9}The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. +} +\par\nointerlineskip +\colorbox{violet9}{% + \strut\color{brown3}The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. +} +\par\nointerlineskip +\colorbox{brown3}{% + \strut\color{violet9}The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. +} + +\bigskip +\hrule +\bigskip + +If you need to select more contrasting foreground and background colors, which may have other hues, +you could visit \href{https://lvjr.bitbucket.io/contrast.html}{WCAG Color Contrast Tool} +page which is designed by the author. + +\end{document} diff --git a/Master/texmf-dist/tex/latex/ninecolors/ninecolors.sty b/Master/texmf-dist/tex/latex/ninecolors/ninecolors.sty new file mode 100644 index 00000000000..53319974777 --- /dev/null +++ b/Master/texmf-dist/tex/latex/ninecolors/ninecolors.sty @@ -0,0 +1,143 @@ +%%% -*- coding: utf-8 -*- +%%% ---------------------------------------------------------------------------- +%%% Ninecolors: Select colors with proper WCAG color contrast +%%% Author : Jianrui Lyu <tolvjr@163.com> +%%% Repository: https://github.com/lvjr/ninecolors +%%% License : The LaTeX Project Public License 1.3 +%%% ---------------------------------------------------------------------------- + +\NeedsTeXFormat{LaTeX2e} +\ProvidesClass{ninecolors}[2021/04/11 v2021A Select colors with proper color contrast] +\RequirePackage{xcolor} +\selectcolormodel{rgb} + +\definecolor{gray1}{gray}{0.14} +\definecolor{gray2}{gray}{0.23} +\definecolor{gray3}{gray}{0.30} +\definecolor{gray4}{gray}{0.38} +\definecolor{gray5}{gray}{0.46} +\definecolor{gray6}{gray}{0.55} +\definecolor{gray7}{gray}{0.64} +\definecolor{gray8}{gray}{0.75} +\definecolor{gray9}{gray}{0.87} + +\definecolor{red1}{Hsb}{0,0.67,0.26}%{0,0.95,0.31} +\definecolor{red2}{Hsb}{0,0.67,0.41} +\definecolor{red3}{Hsb}{0,0.67,0.54} +\definecolor{red4}{Hsb}{0,0.67,0.67} +\definecolor{red5}{Hsb}{0,0.60,0.77} +\definecolor{red6}{Hsb}{0,0.46,0.81} +\definecolor{red7}{Hsb}{0,0.34,0.86} +\definecolor{red8}{Hsb}{0,0.22,0.90} +\definecolor{red9}{Hsb}{0,0.11,0.95} + +\definecolor{brown1}{Hsb}{30,0.67,0.19} +\definecolor{brown2}{Hsb}{30,0.67,0.31} +\definecolor{brown3}{Hsb}{30,0.67,0.41} +\definecolor{brown4}{Hsb}{30,0.67,0.51} +\definecolor{brown5}{Hsb}{30,0.67,0.62} +\definecolor{brown6}{Hsb}{30,0.67,0.74} +\definecolor{brown7}{Hsb}{30,0.49,0.80} +\definecolor{brown8}{Hsb}{30,0.32,0.86} +\definecolor{brown9}{Hsb}{30,0.15,0.93} + +\definecolor{yellow1}{Hsb}{60,0.67,0.15} +\definecolor{yellow2}{Hsb}{60,0.67,0.23} +\definecolor{yellow3}{Hsb}{60,0.67,0.31} +\definecolor{yellow4}{Hsb}{60,0.67,0.39} +\definecolor{yellow5}{Hsb}{60,0.67,0.47} +\definecolor{yellow6}{Hsb}{60,0.67,0.56} +\definecolor{yellow7}{Hsb}{60,0.67,0.66} +\definecolor{yellow8}{Hsb}{60,0.59,0.77} +\definecolor{yellow9}{Hsb}{60,0.27,0.88} + +\definecolor{olive1}{Hsb}{90,0.67,0.16} +\definecolor{olive2}{Hsb}{90,0.67,0.25} +\definecolor{olive3}{Hsb}{90,0.67,0.33} +\definecolor{olive4}{Hsb}{90,0.67,0.42} +\definecolor{olive5}{Hsb}{90,0.67,0.51} +\definecolor{olive6}{Hsb}{90,0.67,0.60} +\definecolor{olive7}{Hsb}{90,0.67,0.71} +\definecolor{olive8}{Hsb}{90,0.48,0.81} +\definecolor{olive9}{Hsb}{90,0.22,0.90} + +\definecolor{green1}{Hsb}{120,0.67,0.16} +\definecolor{green2}{Hsb}{120,0.67,0.26} +\definecolor{green3}{Hsb}{120,0.67,0.35} +\definecolor{green4}{Hsb}{120,0.67,0.44} +\definecolor{green5}{Hsb}{120,0.67,0.53} +\definecolor{green6}{Hsb}{120,0.67,0.63} +\definecolor{green7}{Hsb}{120,0.67,0.74} +\definecolor{green8}{Hsb}{120,0.42,0.83} +\definecolor{green9}{Hsb}{120,0.19,0.91} + +\definecolor{teal1}{Hsb}{150,0.67,0.16} +\definecolor{teal2}{Hsb}{150,0.67,0.26} +\definecolor{teal3}{Hsb}{150,0.67,0.34} +\definecolor{teal4}{Hsb}{150,0.67,0.43} +\definecolor{teal5}{Hsb}{150,0.67,0.52} +\definecolor{teal6}{Hsb}{150,0.67,0.62} +\definecolor{teal7}{Hsb}{150,0.67,0.73} +\definecolor{teal8}{Hsb}{150,0.44,0.82} +\definecolor{teal9}{Hsb}{150,0.20,0.91} + +\definecolor{cyan1}{Hsb}{180,0.67,0.16} +\definecolor{cyan2}{Hsb}{180,0.67,0.25} +\definecolor{cyan3}{Hsb}{180,0.67,0.33} +\definecolor{cyan4}{Hsb}{180,0.67,0.42} +\definecolor{cyan5}{Hsb}{180,0.67,0.51} +\definecolor{cyan6}{Hsb}{180,0.67,0.60} +\definecolor{cyan7}{Hsb}{180,0.67,0.71} +\definecolor{cyan8}{Hsb}{180,0.47,0.81} +\definecolor{cyan9}{Hsb}{180,0.21,0.90} + +\definecolor{azure1}{Hsb}{210,0.67,0.22} +\definecolor{azure2}{Hsb}{210,0.67,0.35} +\definecolor{azure3}{Hsb}{210,0.67,0.47} +\definecolor{azure4}{Hsb}{210,0.67,0.59} +\definecolor{azure5}{Hsb}{210,0.67,0.71} +\definecolor{azure6}{Hsb}{210,0.56,0.78} +\definecolor{azure7}{Hsb}{210,0.41,0.83} +\definecolor{azure8}{Hsb}{210,0.27,0.88} +\definecolor{azure9}{Hsb}{210,0.13,0.94} + +\definecolor{blue1}{Hsb}{240,0.67,0.34} +\definecolor{blue2}{Hsb}{240,0.67,0.53} +\definecolor{blue3}{Hsb}{240,0.67,0.70} +\definecolor{blue4}{Hsb}{240,0.58,0.77} +\definecolor{blue5}{Hsb}{240,0.48,0.81} +\definecolor{blue6}{Hsb}{240,0.39,0.84} +\definecolor{blue7}{Hsb}{240,0.29,0.87} +\definecolor{blue8}{Hsb}{240,0.19,0.91} +\definecolor{blue9}{Hsb}{240,0.10,0.95} + +\definecolor{violet1}{Hsb}{270,0.67,0.29} +\definecolor{violet2}{Hsb}{270,0.67,0.45} +\definecolor{violet3}{Hsb}{270,0.67,0.60} +\definecolor{violet4}{Hsb}{270,0.67,0.75} +\definecolor{violet5}{Hsb}{270,0.54,0.79} +\definecolor{violet6}{Hsb}{270,0.43,0.82} +\definecolor{violet7}{Hsb}{270,0.32,0.86} +\definecolor{violet8}{Hsb}{270,0.21,0.90} +\definecolor{violet9}{Hsb}{270,0.11,0.95} + +\definecolor{magenta1}{Hsb}{300,0.67,0.23} +\definecolor{magenta2}{Hsb}{300,0.67,0.37} +\definecolor{magenta3}{Hsb}{300,0.67,0.49} +\definecolor{magenta4}{Hsb}{300,0.67,0.61} +\definecolor{magenta5}{Hsb}{300,0.67,0.74} +\definecolor{magenta6}{Hsb}{300,0.51,0.80} +\definecolor{magenta7}{Hsb}{300,0.37,0.84} +\definecolor{magenta8}{Hsb}{300,0.24,0.89} +\definecolor{magenta9}{Hsb}{300,0.12,0.94} + +\definecolor{purple1}{Hsb}{330,0.67,0.25} +\definecolor{purple2}{Hsb}{330,0.67,0.39} +\definecolor{purple3}{Hsb}{330,0.67,0.52} +\definecolor{purple4}{Hsb}{330,0.67,0.65} +\definecolor{purple5}{Hsb}{330,0.63,0.76} +\definecolor{purple6}{Hsb}{330,0.48,0.81} +\definecolor{purple7}{Hsb}{330,0.35,0.85} +\definecolor{purple8}{Hsb}{330,0.23,0.90} +\definecolor{purple9}{Hsb}{330,0.11,0.95} + |