From 57d6bcf32cb668aefc1dcba0ed4f3d21083c2373 Mon Sep 17 00:00:00 2001 From: WEN Hao Date: Sat, 1 Oct 2022 12:19:58 +0800 Subject: [PATCH] Put color definitions in a standalone file #136; add color settings for social icons --- .gitignore | 1 + commons/colors.tex | 35 +++++++++++++++ moderncviconsacademic.sty | 16 ++++--- moderncviconsawesome.sty | 91 ++++++++++++++++++++++++++------------- 4 files changed, 108 insertions(+), 35 deletions(-) create mode 100644 commons/colors.tex diff --git a/.gitignore b/.gitignore index 9235563..84f231c 100644 --- a/.gitignore +++ b/.gitignore @@ -7,6 +7,7 @@ *.log *.out *.synctex.gz +*.xdv # template.tex output # move to *.pdf once manual is done diff --git a/commons/colors.tex b/commons/colors.tex new file mode 100644 index 0000000..aaa6319 --- /dev/null +++ b/commons/colors.tex @@ -0,0 +1,35 @@ +%------------------------------------------------------------------------------- +% built-in colors +%------------------------------------------------------------------------------- + +\definecolor{black}{RGB}{0, 0, 0} +\definecolor{red}{rgb}{0.95, 0.20, 0.20} +\definecolor{darkgrey}{rgb}{0.45, 0.45, 0.45} +\definecolor{orange}{rgb}{0.95, 0.55, 0.15} +\definecolor{burgundy}{rgb}{0.596078, 0, 0}% 139/255 (0.545098) or 152/255 (0.596078) +\definecolor{purple}{rgb}{0.50, 0.33, 0.80} +\definecolor{lightblue}{rgb}{0.22, 0.45, 0.70} +\definecolor{green}{rgb}{0.35, 0.70, 0.30} + +%------------------------------------------------------------------------------- +% default colors +%------------------------------------------------------------------------------- + +\colorlet{default-socialicon-color}{darkgrey} + +%------------------------------------------------------------------------------- +% colors for social icons +%------------------------------------------------------------------------------- + +% \definecolor{weixin}{rgb}{.184, .533, .098} +% \definecolor{linkedin}{HTML}{0a66c2} +% \definecolor{orcid}{HTML}{a6ce39} +% \definecolor{twitter}{RGB}{29, 155, 240} +% \definecolor{facebook}{HTML}{1b74e4} +% TODO: add more colors + +%------------------------------------------------------------------------------- +% custom colors +%------------------------------------------------------------------------------- + +% \definecolor{tsinghua}{HTML}{791CB5} diff --git a/moderncviconsacademic.sty b/moderncviconsacademic.sty index 1fffeb3..79f8ec9 100644 --- a/moderncviconsacademic.sty +++ b/moderncviconsacademic.sty @@ -18,11 +18,17 @@ %------------------------------------------------------------------------------- % Package for academic icons \RequirePackage{academicons} +\RequirePackage{xcolor} %------------------------------------------------------------------------------- -% colors +% set colors %------------------------------------------------------------------------------- -\definecolor{orcid}{HTML}{a6ce39} +\input{commons/colors} + +\providecolor{orcid}{named}{default-socialicon-color} +\providecolor{researchgate}{named}{default-socialicon-color} +\providecolor{researcherid}{named}{default-socialicon-color} +\providecolor{googlescholar}{named}{default-socialicon-color} %------------------------------------------------------------------------------- % all symbols described in moderncv.cls @@ -44,9 +50,9 @@ %\newcommand*{\bitbucketsocialsymbol} {} %\newcommand*{\skypesocialsymbol} {} \renewcommand*{\orcidsocialsymbol} {{\color{orcid}\small\aiOrcid}~} -\renewcommand*{\researchgatesocialsymbol} {{\small\aiResearchGateSquare}~} % alternative: \aiResearchGate -\renewcommand*{\researcheridsocialsymbol} {{\small\aiResearcherIDSquare}~} % alternative: \aiResearcherID -\renewcommand*{\googlescholarsocialsymbol}{{\small\aiGoogleScholar}~} +\renewcommand*{\researchgatesocialsymbol} {{\color{researchgate}\small\aiResearchGateSquare}~} % alternative: \aiResearchGate +\renewcommand*{\researcheridsocialsymbol} {{\color{researcherid}\small\aiResearcherIDSquare}~} % alternative: \aiResearcherID +\renewcommand*{\googlescholarsocialsymbol}{{\color{googlescholar}\raisebox{-1pt}{\large\aiGoogleScholar}}~} %\newcommand*{\telegramsocialsymbol} {} %\newcommand*{\whatsappsocialsymbol} {} %\newcommand*{\matrixsocialsymbol} {} diff --git a/moderncviconsawesome.sty b/moderncviconsawesome.sty index 828cb93..597afc4 100644 --- a/moderncviconsawesome.sty +++ b/moderncviconsawesome.sty @@ -17,13 +17,44 @@ %------------------------------------------------------------------------------- % Font Awesome font \RequirePackage{fontawesome5} +\RequirePackage{xcolor} %------------------------------------------------------------------------------- -% colors +% set colors %------------------------------------------------------------------------------- -\definecolor{linkedin}{HTML}{0a66c2} -\definecolor{orcid}{HTML}{a6ce39} -\definecolor{twitter}{RGB}{29, 155, 240} +\input{commons/colors} + +\providecolor{address}{named}{default-socialicon-color} +\providecolor{mobilephone}{named}{default-socialicon-color} +\providecolor{fixedphone}{named}{default-socialicon-color} +\providecolor{faxphone}{named}{default-socialicon-color} +\providecolor{email}{named}{default-socialicon-color} +\providecolor{homepage}{named}{default-socialicon-color} +\providecolor{googlescholar}{named}{default-socialicon-color} +\providecolor{linkedin}{named}{default-socialicon-color} +\providecolor{xing}{named}{default-socialicon-color} +\providecolor{twitter}{named}{default-socialicon-color} +\providecolor{mastodon}{named}{default-socialicon-color} +\providecolor{github}{named}{default-socialicon-color} +\providecolor{gitlab}{named}{default-socialicon-color} +\providecolor{stackoverflow}{named}{default-socialicon-color} +\providecolor{bitbucket}{named}{default-socialicon-color} +\providecolor{skype}{named}{default-socialicon-color} +\providecolor{orcid}{named}{default-socialicon-color} +\providecolor{researchgate}{named}{default-socialicon-color} +\providecolor{telegram}{named}{default-socialicon-color} +\providecolor{whatsapp}{named}{default-socialicon-color} +\providecolor{discord}{named}{default-socialicon-color} +\providecolor{twitch}{named}{default-socialicon-color} +\providecolor{youtube}{named}{default-socialicon-color} +\providecolor{tiktok}{named}{default-socialicon-color} +\providecolor{instagram}{named}{default-socialicon-color} +\providecolor{soundcloud}{named}{default-socialicon-color} +\providecolor{steam}{named}{default-socialicon-color} +\providecolor{xbox}{named}{default-socialicon-color} +\providecolor{playstation}{named}{default-socialicon-color} +\providecolor{battlenet}{named}{default-socialicon-color} +\providecolor{born}{named}{default-socialicon-color} %------------------------------------------------------------------------------- % all symbols described in moderncv.cls @@ -35,39 +66,39 @@ %\renewcommand*{\addresssymbol} {} -\renewcommand*{\mobilephonesymbol} {{\small\faMobile*}~} % alternative: \faMobile (solid style) -\renewcommand*{\fixedphonesymbol} {{\small\faPhone*}~} % alternative: \faPhone (reversed) -\renewcommand*{\faxphonesymbol} {{\small\faFax}~} % alternative: \faPrint -\renewcommand*{\emailsymbol} {{\small\faEnvelope[regular]}~} % alternative: \faInbox, \faEnvelope (solid style) -\renewcommand*{\homepagesymbol} {{\small\faGlobeAmericas}~} % alternative: \faHome, \faGlobe, \faGlobeEurope, \faGlobeAfrica, \faGlobeAsia +\renewcommand*{\mobilephonesymbol} {{\color{mobilephone}\small\faMobile*}~} % alternative: \faMobile (solid style) +\renewcommand*{\fixedphonesymbol} {{\color{fixedphone}\small\faPhone*}~} % alternative: \faPhone (reversed) +\renewcommand*{\faxphonesymbol} {{\color{faxphone}\small\faFax}~} % alternative: \faPrint +\renewcommand*{\emailsymbol} {{\color{email}\small\faEnvelope[regular]}~} % alternative: \faInbox, \faEnvelope (solid style) +\renewcommand*{\homepagesymbol} {{\color{homepage}\small\faGlobeAmericas}~} % alternative: \faHome, \faGlobe, \faGlobeEurope, \faGlobeAfrica, \faGlobeAsia \renewcommand*{\linkedinsocialsymbol} {{\color{linkedin}\small\faLinkedinIn}~} % alternative: \faLinkedin -\renewcommand*{\xingsocialsymbol} {{\small\faXing}~} % alternative: \faXingSquare +\renewcommand*{\xingsocialsymbol} {{\color{xing}\small\faXing}~} % alternative: \faXingSquare \renewcommand*{\twittersocialsymbol} {{\color{twitter}\small\faTwitter}~} % alternative: \faTwitterSquare -\renewcommand*{\mastodonsocialsymbol} {{\small\faMastodon}~} -\renewcommand*{\githubsocialsymbol} {{\small\faGithub}~} % alternative: \faGithubSquare, \faGithub* -\renewcommand*{\gitlabsocialsymbol} {{\small\faGitlab}~} -\renewcommand*{\stackoverflowsocialsymbol}{{\small\faStackOverflow}~} -\renewcommand*{\bitbucketsocialsymbol} {{\small\faBitbucket}~} -\renewcommand*{\skypesocialsymbol} {{\small\faSkype}~} +\renewcommand*{\mastodonsocialsymbol} {{\color{mastodon}\small\faMastodon}~} +\renewcommand*{\githubsocialsymbol} {{\color{github}\small\faGithub}~} % alternative: \faGithubSquare, \faGithub* +\renewcommand*{\gitlabsocialsymbol} {{\color{gitlab}\small\faGitlab}~} +\renewcommand*{\stackoverflowsocialsymbol}{{\color{stackoverflow}\small\faStackOverflow}~} +\renewcommand*{\bitbucketsocialsymbol} {{\color{bitbucket}\small\faBitbucket}~} +\renewcommand*{\skypesocialsymbol} {{\color{skype}\small\faSkype}~} \renewcommand*{\orcidsocialsymbol} {{\color{orcid}\small\faOrcid}~} -\renewcommand*{\researchgatesocialsymbol} {{\small\faResearchgate}~} +\renewcommand*{\researchgatesocialsymbol} {{\color{researchgate}\small\faResearchgate}~} %\renewcommand*{\researcheridsocialsymbol} {} %\renewcommand*{\googlescholarsocialsymbol}{} -\renewcommand*{\telegramsocialsymbol} {{\small\faTelegram}~} -\renewcommand*{\whatsappsocialsymbol} {{\small\faWhatsapp}~} -\renewcommand*{\discordsocialsymbol} {{\small\faDiscord}~} -\renewcommand*{\twitchsocialsymbol} {{\small\faTwitch}~} -\renewcommand*{\youtubesocialsymbol} {{\small\faYoutube}~} -\renewcommand*{\tiktoksocialsymbol} {{\small\faTiktok}~} -\renewcommand*{\instagramsocialsymbol} {{\small\faInstagram}~} -\renewcommand*{\soundcloudsocialsymbol} {{\small\faSoundcloud}~} -\renewcommand*{\steamsocialsymbol} {{\small\faSteam}~} -\renewcommand*{\xboxsocialsymbol} {{\small\faXbox}~} -\renewcommand*{\playstationsocialsymbol} {{\small\faPlaystation}~} -\renewcommand*{\battlenetsocialsymbol} {{\small\faBattleNet}~} +\renewcommand*{\telegramsocialsymbol} {{\color{telegram}\small\faTelegram}~} +\renewcommand*{\whatsappsocialsymbol} {{\color{whatsapp}\small\faWhatsapp}~} +\renewcommand*{\discordsocialsymbol} {{\color{discord}\small\faDiscord}~} +\renewcommand*{\twitchsocialsymbol} {{\color{twitch}\small\faTwitch}~} +\renewcommand*{\youtubesocialsymbol} {{\color{youtube}\small\faYoutube}~} +\renewcommand*{\tiktoksocialsymbol} {{\color{tiktok}\small\faTiktok}~} +\renewcommand*{\instagramsocialsymbol} {{\color{instagram}\small\faInstagram}~} +\renewcommand*{\soundcloudsocialsymbol} {{\color{soundcloud}\small\faSoundcloud}~} +\renewcommand*{\steamsocialsymbol} {{\color{steam}\small\faSteam}~} +\renewcommand*{\xboxsocialsymbol} {{\color{xbox}\small\faXbox}~} +\renewcommand*{\playstationsocialsymbol} {{\color{playstation}\small\faPlaystation}~} +\renewcommand*{\battlenetsocialsymbol} {{\color{battlenet}\small\faBattleNet}~} %\renewcommand*{\signalsocialsymbol} {} %\renewcommand*{\matrixsocialsymbol} {} -\renewcommand*{\bornsymbol} {{\small\faAsterisk}~} % alternative: \faBabyCarriage +\renewcommand*{\bornsymbol} {{\color{born}\small\faAsterisk}~} % alternative: \faBabyCarriage \endinput