asciidocfx / AsciidocFX

Asciidoc Editor and Toolchain written with JavaFX 21 (Build PDF, Epub, Mobi and HTML books, documents and slides)
http://www.asciidocfx.com/
Apache License 2.0
1.86k stars 297 forks source link

Changing text color in preview #638

Open Rafinator07 opened 2 months ago

Rafinator07 commented 2 months ago

I try to change text color like this :

[blue]#My Text#
[pink]#My Second Text#

'blue' is working but 'pink' does'nt work. I don't know where the settings file is, which would allow me to add my own colors.

rahmanusta commented 2 months ago

You can use purple instead of pink

[blue]#My Text#
[purple]#My Second Text#
asciidoctor.css has the colors declared

.aqua{color:#00bfbf}
.aqua-background{background:#00fafa}
.black{color:#000}
.black-background{background:#000}
.blue{color:#0000bf}
.blue-background{background:#0000fa}
.fuchsia{color:#bf00bf}
.fuchsia-background{background:#fa00fa}
.gray{color:#606060}
.gray-background{background:#7d7d7d}
.green{color:#006000}
.green-background{background:#007d00}
.lime{color:#00bf00}
.lime-background{background:#00fa00}
.maroon{color:#600000}
.maroon-background{background:#7d0000}
.navy{color:#000060}
.navy-background{background:#00007d}
.olive{color:#606000}
.olive-background{background:#7d7d00}
.purple{color:#600060}
.purple-background{background:#7d007d}
.red{color:#bf0000}
.red-background{background:#fa0000}
.silver{color:#909090}
.silver-background{background:#bcbcbc}
.teal{color:#006060}
.teal-background{background:#007d7d}
.white{color:#bfbfbf}
.white-background{background:#fafafa}
.yellow{color:#bfbf00}
.yellow-background{background:#fafa00}

You can override the default css by the way.

Rafinator07 commented 1 month ago

This isn't working, but when i generate html, I just add my color in the code directly. Before I mark my lines with the new color

rahmanusta commented 1 month ago

You need custom css/theme. Check how to override asciidoctor’s default css and provide custom css.