Typora字体颜色设置的3种方案

Typora没有直接设置字体颜色的功能,不能像word一样,选中字体直接设置想要的颜色。

于是我在网上为大家找到了三种在Typora工具中设置字体颜色的方案。

下面第一种方法需安装软件AutoHotKey,操作起来比较简单,建议新手使用;后两种方法都是偏技术的,对于非技术的小白可能理解上或者使用时有点困难,不过问题也不大,不会的直接从下文复制到Typora使用即可,建议收藏使用!

1、下载AutoHotKey(较简单)

AutoHotKey是一款著名的windows系统快捷键设置的软件,轻便小巧。

官方下载地址: https://autohotkey.com/download/ahk-install.exe

使用步骤如下:

  • 先安装AutoHotKey

  • 打开记事本,把下面的内容复制粘贴进去:

    ; Typora
    ; 快捷增加字体颜色
    ; SendInput {
          
          Text} 解决中文输入法问题
     
    #IfWinActive ahk_exe Typora.exe
    {
          
          
        ; Ctrl+Alt+O 橙色
        ^!o::addFontColor("orange")
     
        ; Ctrl+Alt+R 红色
        ^!r::addFontColor("red")
     
        ; Ctrl+Alt+B 浅蓝色
        ^!b::addFontColor("cornflowerblue")
    }
     
    ; 快捷增加字体颜色
    addFontColor(color){
          
          
        clipboard := "" ; 清空剪切板
        Send {
          
          ctrl down}c{
          
          ctrl up} ; 复制
        SendInput {
          
          TEXT}<font color='%color%'>
        SendInput {
          
          ctrl down}v{
          
          ctrl up} ; 粘贴
        If(clipboard = ""){
          
          
            SendInput {
          
          TEXT}</font> ; Typora 在这不会自动补充
        }else{
          
          
            SendInput {
          
          TEXT}</ ; Typora中自动补全标签
        }
    }
    
  • 将文件保存为ahk后缀的文件,如AutoHotKey.ahk

  • 双击运行

  • 在Typora软件里就可以使用快捷键进行想要的修改操作了(想要更多的快捷键设置方式,可以在AutoHotKey.ahk文件中自行添加):

    如按 Ctrl+Alt+O 添加橙色, Ctrl+Alt+R 红色,按 Ctrl+\ 取消样式!

  • 也可以右键 AutoHotKey.ahk 脚本文件,点击Compile Script编译脚本成exe程序,就可以不用下载Autohotkey在其他电脑上运行了。

提示:上面脚本只写了橙色、红色、浅蓝三种颜色,你可以按需照例增加其他颜色或快捷方式!

2、进入开发者模式改html代码(懂前端技术超简单)

  • 右键——>检查元素
  • 视图——>开发者工具,打开html代码调试模式
  • 按快捷键 Shift+F12

下面给大家看一个修改案例:

<span style="color:文字颜色;background:背景颜色;font-size:文字大小;font-family:字体;">你要改色的文字</span>

很明显,用这种方式进行代码的修改需要一定的前端基础,至少需要懂得一些简单的标签并记住。

不过我们也可以按照模板,修改字体的style属性即可,意思是我们想要使用这种方式的时候就查一查这篇文章,然后复制过去。

示例:
style="color:red"

style="color:maroon"

style="color:fuchsia"

style="color:brown"

style="color:blue"

style="color:aqua"

style="color:green"

style="color:orange"

style="color:purple"

style="color:white;background:black;"

style="background:yellow"

style="background:red"

style="background:orange"

style="color:white;background:green"

style="color:white;background:blue"

这种方式还存在一个弊端,当我们用这种方式进行字体修改之后,再将文章用其他工具打开,或者发表到博客上,你就会发现你做的修改都消失了,这是因为Typora支持开发者模式用代码的方式进行元素审查,但是其他工具中并没有这个功能,那么既然没有这个载体,怎么会保留这种方式做的修改呢?

3、方案三:使用内联公式(既复杂也简单)

使用步骤如下:

  • 开启使用内联公式

    文件——>偏好设置(Ctrl+逗号)——>Markdown——>勾选“内联公式”——>重启Typora

  • 输入公式代码进行颜色修改

    输入$,按Esc键会自动在后面加上一个$,然后在这两个$之间输入公式。
    	     样式如下:
    ——>	     $\textcolor{red}{这里输入你要改变颜色的文字}$
    
    

    颜色公式代码大全:

    $\textcolor{GreenYellow}{GreenYellow} $
    $\textcolor{Yellow}{Yellow}$
    $\textcolor{Goldenrod}{Goldenrod} $
    $\textcolor{Dandelion}{Dandelion}$
    $\textcolor{Apricot}{Apricot} $
    $\textcolor{Peach}{Peach}$
    $\textcolor{Melon}{Melon} $
    $\textcolor{YellowOrange}{YellowOrange}$
    $\textcolor{Orange}{Orange} $
    $\textcolor{BurntOrange}{BurntOrange}$
    $\textcolor{Bittersweet}{Bittersweet}$
    $\textcolor{RedOrange}{RedOrange} $
    $\textcolor{Mahogany}{Mahogany}$
    $\textcolor{Maroon}{Maroon} $
    $\textcolor{BrickRed}{BrickRed}$
    $\textcolor{Red}{Red} $
    $\textcolor{OrangeRed}{OrangeRed}$
    $\textcolor{RubineRed}{RubineRed}$
    $\textcolor{WildStrawberry}{WildStrawberry}$
    $\textcolor{Salmon}{Salmon}$
    $\textcolor{CarnationPink}{CarnationPink}$
    $\textcolor{Magenta}{Magenta} $
    $\textcolor{VioletRed}{VioletRed}$
    $\textcolor{Rhodamine}{Rhodamine} $
    $\textcolor{Mulberry}{Mulberry}$
    $\textcolor{RedViolet}{RedViolet} $
    $\textcolor{Fuchsia}{Fuchsia}$
    $\textcolor{Lavender}{Lavender} $
    $\textcolor{Thistle}{Thistle}$
    $\textcolor{Orchid}{Orchid} $
    $\textcolor{DarkOrchid}{DarkOrchid}$
    $\textcolor{Purple}{Purple} $
    $\textcolor{Plum}{Plum}$
    $\textcolor{Violet}{Violet} $
    $\textcolor{RoyalPurple}{RoyalPurple}$
    $\textcolor{BlueViolet}{BlueViolet}$
    $\textcolor{Periwinkle}{Periwinkle}$
    $\textcolor{CadetBlue}{CadetBlue}$
    $\textcolor{CornflowerBlue}{CornflowerBlue}$
    $\textcolor{MidnightBlue}{MidnightBlue}$
    $\textcolor{NavyBlue}{NavyBlue} $
    $\textcolor{RoyalBlue}{RoyalBlue}$
    $\textcolor{Blue}{Blue} $
    $\textcolor{Cerulean}{Cerulean}$
    $\textcolor{Cyan}{Cyan} $
    $\textcolor{ProcessBlue}{ProcessBlue}$
    $\textcolor{SkyBlue}{SkyBlue} $
    $\textcolor{Turquoise}{Turquoise}$
    $\textcolor{TealBlue}{TealBlue} $
    $\textcolor{Aquamarine}{Aquamarine}$
    $\textcolor{BlueGreen}{BlueGreen} $
    $\textcolor{Emerald}{Emerald}$
    $\textcolor{JungleGreen}{JungleGreen}$
    $\textcolor{SeaGreen}{SeaGreen} $
    $\textcolor{Green}{Green}$
    $\textcolor{ForestGreen}{ForestGreen}$
    $\textcolor{PineGreen}{PineGreen} $
    $\textcolor{LimeGreen}{LimeGreen}$
    $\textcolor{YellowGreen}{YellowGreen}$
    $\textcolor{SpringGreen}{SpringGreen}$
    $\textcolor{OliveGreen}{OliveGreen}$
    $\textcolor{RawSienna}{RawSienna} $
    $\textcolor{Sepia}{Sepia}$
    $\textcolor{Brown}{Brown} $
    $\textcolor{Tan}{Tan}$
    $\textcolor{Gray}{Gray} $
    $\textcolor{Black}{Black}$
    

    为什么说这个办法复杂呢?因为公式太多记不住,也没必要。说它简单是因为这种方式可以和上面的方式一样,复制粘贴即可使用。

    有需要的小伙伴可以收藏使用,希望能帮助到大家!

猜你喜欢

转载自blog.csdn.net/liulei952413829/article/details/114670380