77 10
Sign in to rate

Quick Colour Changing

<10kB. Updated 2017-08-28.
The author has shared 13 other item(s).

Description

This addon allows you to define shortcut keys to set the selected text to a specific colour in the editor. In Anki 2.1, you can customize the shortcuts and colours by clicking on Config in the add-ons dialog. In Anki 2.0, you'll need to edit the add-on source code.

Download

As add-ons are programs downloaded from the internet, they are potentially malicious. You should only download add-ons you trust.

Supported Anki versions:

To download this add-on, please copy and paste the following code into Anki 2.1:

2491935955

If you were linked to this page from the internet, please open Anki on your computer, go to the Tools menu and then Add-ons>Browse & Install to paste in the code.

All Anki 2.1.x Add-Ons

Reviews

on 1633687899
USING IN RAPID REVIEW AND BROWSER

This app is very useful, but the color changing shortcuts are not working in the quick-edit card section in the card browser. If this would work in that section, I would gladly rate it 5 stars. The shortcuts will work in review and browser
on 1633108529
Good add on
on 1632247733
Very convenient thanks
on 1628002475
Great, thanks a lot!
on 1627708265
If you are using this plugin on a Mac, be sure to pay attention to the configuration file, Ctrl will map to Command, Meta will map to Ctrl. The following is from PyQt's documentation

On macOS, references to “Ctrl”, CTRL , Key_Control and ControlModifier correspond to the Command keys on the Macintosh keyboard, and references to “Meta”, META , Key_Meta and MetaModifier correspond to the Control keys. Developers on macOS can use the same shortcut descriptions across all platforms, and their applications will automatically work as expected on macOS.

https://doc.qt.io/qtforpython-5/PySide2/QtGui/QKeySequence.html#more
on 1625743191
Godsend!! 😋

I use it daily, each time I write a new card, as I like to make additional information surrounded by parentheses to be of gray colour.
on 1624174623
Good time saver
on 1622155413
Thanks very much for the Add-on! I use it a lot and it saves a huge amount of time.
on 1618903386
this works like charm, as I'm already used to this in other program ,which is assign short cut key to high light text with certain color. I'm disappointed to see most downvotes comes from the people who didn't bother to spend time examining how to use it in the first place.
on 1617361303
Should be implemented in Anki
Must have add-on
on 1614211866
Great work! The user must be careful to use shotcuts that won't affect the normal functions of anki (or other addons).

My keys:
{
"keys": [
[
"black",
"Alt+1"
],
[
"red",
"Alt+2"
],
[
"green",
"Alt+3"
],
[
"blue",
"Alt+4"
]
]
}
on 1609304890
This allows me to modify font color along with colors of Anki iOS edition much more easily!
I referred to another fan's configuration, and slightly modified key assign to work in Anki 2.1.22 as below.

(*) Shift+Ctrl+r, Shift+Ctrl+e didn't work in my environment.

{
"keys": [
[ "#0a84ff", "Shift+Ctrl+b" ],
[ "#30d158", "Shift+Ctrl+g" ],
[ "#ff9f0a", "F11" ],
[ "#ff453a", "F12" ]
]
}

------
It worked on Windows 10 and Linux (Fedora).
It needs restart of Anki to make changes take effect.
on 1604804707
effective
on 1602930875
Really a pitty that F3 doesn't work.

Besides that an absolutely great tool. If it doesn't work at all for for you, try restarting Anki.
on 1597405598
simple, works great on Mac OS on both Browser and in Add mode, you just have to restart after editing the shortcuts. I use:
{ "keys": [ [ "green","Alt+x" ], [ "blue", "Alt+z" ], [ "orange", "Alt+a" ], [ "black", "Alt+s" ] ] }
on 1594972823
nice!
on 1593719496
Super! It really helped me to save time (4000+ cards lol). I used it for colour-coding my german deck (by gender), so I remember the words with an specific colour depending on its gender.
on 1590934613
Great add-on. Also looking for an add-on where the multiple colors show up on top of the adding/editing screen of a card. Nonetheless this works
on 1590895097
Such a time saver! Thanks for the work on this one :)
on 1590691446
Once you enter the html in 'settings' in 'add ons' (assign colours the keyboard shortcut), you have to close and reopen anki for the changes to take effect.
on 1590500085
If it doesn't work, you could try restarting.
on 1586430916
For anyone interested, I synced the colors with the iOS app for working with the Black background on the phone. These are the same colors the app uses (Using regular Blue was an issue, I just adapted all of them).
The order is: Blue, Green, orangE, Red
„Shift+Cmd+b/g/e/r“ (Cmd is written as Ctrl, see below).

Thanks to those who developed this and those who commented below!

{
"keys": [
[
"#0a84ff",
"Shift+Ctrl+b"
],
[
"#30d158",
"Shift+Ctrl+g"
],
[
"#ff9f0a",
"Shift+Ctrl+e"
],
[
"#ff453a",
"Shift+Ctrl+r"
]
]
}
on 1586389835
Would be awesome to also make it work with "edit while reviewing" add-on is that possible ?
on 1585222446
nice
on 1585069503
Excellent in editor mode; however, it would be awesome if you could make this compatible with the edit field during cloze review/image resizer add-on. Thanks for your work!
on 1581449352
Does not work in the browser
on 1578897104
I love this a lot! Making text transparent is now so much easier

P.S. although I love the addon, I think overwriting the F8 button is a bad idea.
Even if you set the shortcut to something else the F8 button will not return doing its usual job because of the addon.
Fixing it is very easy though
Here's how: https://imgur.com/a/jJYKnoi
on 1578146424
Very helpful in quick entering while doing courses, reading new vocabulary that need to highlight colors
on 1576630945
works well for me...

but saw in the review section some having troubles with adding more than 2 colors, hope the following steps will help( windows 10 anki 2.1 version)


1)after adding the add on , go to the tools -> add-ons -> select the quick color changing -> click config -> then on the configuration window:

it should look like this:
{
"keys": [
[
"red",
"F11"
],
[
"#00f",
"F12"
]
]
}

2) to add more colors or to change the controls:
a) keep the beginning and ending tags intact
beginning tags { "keys": [
ending tags ] }

b) then can edit in between - it was easier for me to use ctrl+ alt keys together as controls
["red", "F11" ], u can change it to ["red","Ctrl+Alt+r" ],
[ "#00f", "F12"] u can change it to ["blue","Ctrl+Alt+b"],

c) to add a color of your choice:
go to anki add page -> change color button or F8 -> in the 'select color' window look for the HTML code for the color and copy it. then you can use it to customize
ex:for purple
["#aa00ff","Ctrl+Alt+p"],

d) you can keep on adding colors and controls of your choice.
*in between 2 color commands there should be a comma and in the last color command no comma is required
ex:
{
"keys": [
["red","Ctrl+Alt+r"],
["blue","Ctrl+Alt+b"],
["#ff00ff ","Ctrl+Alt+x"]
]
}

or you can copy paste the following and edit it as you want -> if it doesn't work go for restore defaults


{
"keys": [
["red","Ctrl+Alt+r"],
["blue","Ctrl+Alt+b"],
["#00ff00","Ctrl+Alt+g"],
["yellow","Ctrl+Alt+y"],
["#aa00ff","Ctrl+Alt+p"],
["#ffaa00","Ctrl+Alt+o"],
["#55aaff","Ctrl+Alt+n"],
["#ff557f","Ctrl+Alt+z"],
["#ff00ff ","Ctrl+Alt+x"]
]
}

e) restart the anki app
on 1575793044
Great. Thanks!

For those who'd like to have (say) four colours, the easiest way to do so is by opening the Addon list, select View Files, duplicate the folder in question, and restart Anki.
on 1575478567
works good. Thank you!
on 1573695766
Thanks!
on 1573018096
ok
on 1567644354
用不了
on 1567414004
Very nice app, but I can not figure out how to add more than 2 colours.
I can change the 2 colours the default setting came with and the hotkeys, but if I try to add more code I just end up with error.
on 1567132922
It can mark some important informations with different colours
on 1565622412
Works for me!
on 1562147012
你好,如果在此基础上,增加设置文字加粗设置就好了。如按一个组合快捷键alt+z,就可设置颜色红色并加粗。如果能实现,那太棒了。
为什么有此需求呢?为了更加突出。
on 1560696550
l can't even open it .Is it my computer's problem?My anki's vension is 2.1.
on 1560421837
添加插件后,需选择“工具”,“附加组件”,选中“Quick Colour Changing”,点击“设置”,可以更改快捷键和颜色,会有提示,希望帮助到你.
After adding the plugin, you need to select "Tools", "Add-ons", select "Quick Colour Changing", click "Config", you can change the shortcut keys and colors, there will be tips, I hope it can help you.
on 1560036472
这玩意怎么用啊,半天 添加不了 新颜色。
on 1559173256
I really have no idea how to use it. No option to apply it anywhere at all! Please write instructions, it'd be of great help.
on 1558428958
I have no idea how to make this program work. There is no explanation, no screenshots, nothing. I assume these are supposed to work in the edit/create screen for new cards but after 30min, I'm giving up on trying to make it work. If this is the "quick" way to change colors, I don't want to know what the slow way is.
on 1557261011
Anki 2.1 version works as expected. I like the new configuration window too. For macOS users, remember that "ctrl" means your command button (⌘), not control (⌃). If you want to use your mac's control button, refer to it as "meta". E.g., ["red", "meta+r"] translates to ⌃ + r on a mac.
on 1554050563
Works great!!!
on 1552689835
Works perfectly!

I had some keyboard hotkey conflicts with Alt, so I opted for Ctrl+Alt instead.

In case anyone has the same issue, here's what works for me:
For blue:
["blue","Ctrl+Alt+b"]
For red:
["red","Ctrl+Alt+r"]
For green:
["green","Ctrl+Alt+g"]
on 1552288338
2491935955
on 1551291076
For those who want info on adding buttons, scroll down to find the review from 9/6. That helped a lot.
Note: I was unable to add buttons to F7 but was able to add to F10. If you find yourself unable to add to one button, try again with another before proceeding to find another fix.
on 1544300045
At the moment this add-on caused a bug where I can't sync Anki. (I don't know if its the add-on itself or the combination between add ons)
Comment from author
Nothing this add-on changes should affect syncing.
on 1543649876
Thanks! It's very convenient, but I cannot use F7 and F8.
on 1540785546
!!!!!!!!!!!!!!!!
on 1540625431
Why this service is not applicable not Anki mobile?😭
on 1540429812
I downloaded python to open __init__.py and this is the code I see.


from aqt import mw

config = mw.addonManager.getConfig(__name__)

from anki.hooks import addHook

def updateColour(editor, colour):
editor.fcolour = colour
editor.onColourChanged()
editor._wrapWithColour(editor.fcolour)

def onSetupShortcuts(cuts, editor):
# add colours
for code, key in config['keys']:
cuts.append((key, lambda c=code: updateColour(editor, c)))

addHook("setupEditorShortcuts", onSetupShortcuts)



Where exactly am I supposed to paste the following ?

("red", "alt+r"),
("blue", "alt+b"),
("chocolate", "alt+c"),
("black", "alt+x"),
("white", "alt+w"),

Please, thank you
on 1539550710
Nice!
on 1537556734
easy to use and edit
on 1537430627
Essential.
on 1536341992
Extremely helpful!
on 1536222335
Je n'arrive pas à changer les réglages, aucun ne fonctionne
on 1534405688
Excellent!
on 1530428559
red
on 1520553600
Excelente !!! Acelerou bastante a criação de novos flashcards!! Adicionei os códigos com as outras cores que os colegas indicaram e ficou melhor ainda
on 1515110400
Saves time making cards and allows entry of whatever HTML colour codes you want
on 1504742400
Works well - tweaks for Macbook user learning Mandarin

This add on is just what I was looking for, and the comments left below were very helpful. To save someone spending the 40 minutes I did on exploring the shortcuts for a Macbook, some tips:

- The 'alt' shortcuts didn't seem to work for me because they interfered with other shortcuts already in the system

- For using the 'F' keys (i.e. fn + the relevant key) I had to disable some functionality associated with those keys before they would work changing colours (e.g. showing all windows at once). This can be done by going to System Preferences>Keyboard>Shortcuts and deselecting the options for F8 - F10 under 'Mission Control', 'Keyboard'. I never really used those F keys so it isn't a problem for me.

- I'm starting to learn Mandarin so I used a slightly different order for the colours which match the order of the tones and how I think of their sounds; and which might be helpful to others (relevant bid of code below).

Blue - F8/1st tone (high tone in sky)
Green - F9/2nd tone (rising from the trees)
Brown - F10/3rd tone (low in the ground/mud)
Red - F11/4th tone (slightly angry sound)
Black - F12

Code extract - put between the [ ]:

("red", "F11"),
("#00f", "F8"), ("#AA5603", "F10"), ("#000", "F12"), ("green", "F9")

Hope this is useful for others. Obviously you can swap around the colours etc.
on 1501113600
works well, saves time!!

Use the belowing code to replace the former one( don't delete [] ). It works in the browser and the new card creating window.
("red", "alt+r"),
("blue", "alt+b"),
("chocolate", "alt+c"),
("black", "alt+x"),
("white", "alt+w"),
on 1491782400
Works well, but 1 major complaint

This app is very useful, but the color changing shortcuts are not working in the quick-edit card section in the card browser. If this would work in that section, I would gladly rate it 5 stars.

Also, the code that the other reviewer posted is very helpful. Thank you for that.
on 1475193600
Clue of add shortcuts

colours = [
("red", "F8"),
("#00f", "F9"), ("#AA5603", "F10"),("#000", "F11"), ("green", "F6")
]
on 1474675200
Great!

Works well. I could also create multikey shortcuts by moving the colours list below the import statements in the code. Below you can see that the yellow color can be applied by hitting Ctrl + P:


from aqt import mw
from aqt.qt import *
from anki.hooks import addHook

colours = [
("yellow", Qt.CTRL + Qt.Key_P),
]
on 1469404800
perhaps need updating

It works well on ver2.0.33, but failed on ver2.0.36
on 1458000000
Old, but still gold!

Though this tool hasn't been updated for almost 4 years, it still works like a charm.

It works on Windows 10, Linux, Mac OS X. I use all these operating systems, and this adds-on works on all of them.

Someone posted 'not working' on mac, which is not true for my Mac OS X El Capitan. For those having trouble making it to work on Mac, please try to press 'fn' key at the same time when you press F8/F9/F10 key.

I also did a little modification to display 3 different colors - more than enough for my use.
on 1456963200
not working

using it on mac.
it's not working.
not F8/F9 nor if i try to use own shortcuts...
i edit and restart but it's not working...

maybe there is need some proper manual? but i don't think i made something wrong
on 1455667200
Yes, yes, yes!

Fantastic! This saves an immense amount of time for visually encoding gender (or really any other category...) into a deck for learners like me.
on 1409616000
Saves times!!

on 1399766400
Thanks to the guy who posted the mod for combo keys!

This addon is not bad, but as it was, it was not very useful. Who posted that little hack, thank you very much, because now it makes sense using this addon.
on 1383696000
Some issues

was hoping it could override the default hotkeys (like F3), but otherwise works great.

also wish Ctrl+R worked in the same way (subsequent text would be normal).