Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Theme contribution] Cyberpunk Night (an AMOLED black theme) #1730

Closed
alemvigh opened this issue Mar 6, 2024 · 22 comments · Fixed by #1738
Closed

[Theme contribution] Cyberpunk Night (an AMOLED black theme) #1730

alemvigh opened this issue Mar 6, 2024 · 22 comments · Fixed by #1738
Labels
enhancement Request: New feature or improvement user interface Component: General user interface
Milestone

Comments

@alemvigh
Copy link

alemvigh commented Mar 6, 2024

I've created an AMOLED black/Cyberpunk style theme that is easy on the eyes and perfect for late night writing sessions.

image

image

Feel free to include it in the default selection of themes since there's currently a lack of dark mode themes, especially AMOLED black ones.

cyberpunk_night.tar.gz

@alemvigh alemvigh added the enhancement Request: New feature or improvement label Mar 6, 2024
@vkbo
Copy link
Owner

vkbo commented Mar 6, 2024

Looks great, I'm happy to take this as a contribution. Could you possibly make a pull request for it? There are a few review points to go through for new themes.

@vkbo
Copy link
Owner

vkbo commented Mar 6, 2024

I realise you may not be familiar with GitHub, since you just created the account. If so, I can of course do it.

@alemvigh
Copy link
Author

alemvigh commented Mar 6, 2024

@vkbo You're right. I'm not that familiar with Github or with any special requirements for this project, so if you could do it that would be appreciated. 👍

I noticed that there's a new version upcoming, so if anything changed regarding the way themes work let me know and I'll update accordingly and test it with the AppImage of the new version.

Also feel free to let me know if anything looks broken on systems other than Linux since I've only got that to test with.

@alemvigh
Copy link
Author

alemvigh commented Mar 6, 2024

Updated the syntax theme because it was missing the "optional" tag as it isn't included on https://novelwriter.io/docs/int_customise.html - I only found it by inspecting one of the original themes. 😃

cyberpunk_night.tar.gz

@vkbo
Copy link
Owner

vkbo commented Mar 6, 2024

The "optional" entry is a 2.3 feature, which has not been released yet. That's why it is not in the documentation yet.

@alemvigh
Copy link
Author

alemvigh commented Mar 6, 2024

cyberpunk_night.tar.gz

Changed errorline to be different from spellcheckline (using the color from the night_owl theme).

@vkbo
Copy link
Owner

vkbo commented Mar 6, 2024

It would be better if the spell check line was consistent with the other colours rather than copied from a different theme. Also, you can just paste the text here instead of the tar.gz files. Just wrap them in three backticks like so: ```.

I would also prefer if you didn't set multiple colour settings that are used to distinguish different elements to the same colour. It defeats some of the purpose of syntax highlighting.

[Main]
name        = Cyberpunk Night
description = A taste of the future 80's
author      = Anders Lemvigh
credit      = 
url         = https://github.com/alemvigh
license     = CC BY-SA 4.0
licenseurl  = https://creativecommons.org/licenses/by-sa/4.0/
icontheme   = typicons_dark

[Palette]
window          = 0, 0, 0
windowtext      = 150, 150, 150
base            = 0, 0, 0
alternatebase   = 0, 0, 0
text            = 150,150,150
tooltipbase     = 50, 0, 180
tooltiptext     = 255,255,255
button          = 0, 0, 0
buttontext      = 150, 150, 150
brighttext      = 255,255,255
highlight       = 50, 0, 180
highlightedtext = 255,255,255
link            = 77,77,255
linkvisited     = 255,0,255

[GUI]
statusnone      = 50, 50, 50
statussaved     = 0, 255, 0
statusunsaved   = 255, 77, 77
[Main]
name       = Cyberpunk Night
author     = Anders Lemvigh
credit     = 
url        = https://github.com/alemvigh
license    = CC BY-SA 4.0
licenseurl = https://creativecommons.org/licenses/by-sa/4.0/

[Syntax]
background     =   0,0,0
text           =   150,150,150
link           =   77,77,255
headertext     =   180, 180, 180
headertag      =   50, 0, 180
emphasis       =   0,255,255
straightquotes =   0,255,0
doublequotes   =   0,255,0
singlequotes   =   0,255,0
hidden         =   128,0,128
shortcode      =   255,0,255
keyword        =   0,255,255
value          =   255,77,77
spellcheckline =   255,77,77
errorline      =   173,219,103
replacetag     =   0,255,255
modifier       =   255,0,255
optional       =   180,180,180

@alemvigh
Copy link
Author

alemvigh commented Mar 6, 2024

@vkbo I'm editing the colors to create more separation between the tag types. Is there a sample text (that includes all available tag types) that I can use? There are some tags like "replacetag" that I haven't been able to test yet.

@vkbo
Copy link
Owner

vkbo commented Mar 6, 2024

You can create an example project from "new project" which will have everything demonstrated. In the example project, the document "Making a Scene" has most elements showcased.

@alemvigh
Copy link
Author

alemvigh commented Mar 6, 2024

@vkbo Thanks! One tag I can't find is "modifier" - how can I make some text that uses it? Also, I'm not sure which tag that corresponds to non-breaking spaces. It seems to use a color that I haven't defined.

@vkbo
Copy link
Owner

vkbo commented Mar 6, 2024

"modifier" is the colour applied to the "%Synopsis:" part of your screenshot. It is referring to the special modifiers for comments.

@vkbo
Copy link
Owner

vkbo commented Mar 6, 2024

You can insert non-breaking spaces from the Insert menu. They should be shown with a different background colour than the regular background. It's the same thing that LibreOffice does. That's where the feature is from.

@alemvigh
Copy link
Author

alemvigh commented Mar 6, 2024

@vkbo I figured out that non-breaking spaces take their color from the "emphasis" tag. Not sure if that's intended or something I should raise an issue for, but at least it allows me to complete the theme now. 😄

emphasis = 255, 0, 0

image

@vkbo
Copy link
Owner

vkbo commented Mar 6, 2024

Yeah, that's probably right.

The theme files are processed here in the code:

def loadSyntax(self) -> bool:

And applied to the document here:

def initHighlighter(self) -> None:

You can track which colour is used for what. There are many colours that are used for multiple things.

@alemvigh
Copy link
Author

alemvigh commented Mar 6, 2024

I've tried to create some more visual separation between the tag types here, and hopefully I managed to catch everything:

[Main]
name       = Cyberpunk Night
author     = Anders Lemvigh
credit     = 
url        = https://github.com/alemvigh
license    = CC BY-SA 4.0
licenseurl = https://creativecommons.org/licenses/by-sa/4.0/

[Syntax]
background     =     0,  0,  0
text           =   150,150,150
link           =    77,077,255
headertext     =   255,255,255
headertag      =    50,  0,180
emphasis       =     0,255,255
straightquotes =     7, 27,219
doublequotes   =     0,255,  0
singlequotes   =     0,140,255
hidden         =    50, 50, 70
shortcode      =   255,255,  0
keyword        =   255,100,255
value          =   255,150, 10
spellcheckline =   242, 72, 23
errorline      =   186,218,  4
replacetag     =   0,  0,  180
modifier       =   144,142,176
optional       =   180,180,180

image

@vkbo
Copy link
Owner

vkbo commented Mar 6, 2024

Looks good! I still think the comments need to be a bit easier to read. That is, the "hidden" colour.

Also, for the GUI theme, you must set "window", "base" and "alternatebase" to different shades. In particular "alternatebase" is used for showing which headings are in the currently open document in the Novel view. If it's the same colour as the background, this feature doesn't work. It is less of a problem that "window" and "base" are the same shade.

@vkbo
Copy link
Owner

vkbo commented Mar 6, 2024

To illustrate what I mean, the three headings starting from "Making a Scene" here are highlighted. That's the "alternatebase" colour.

image

@alemvigh
Copy link
Author

alemvigh commented Mar 6, 2024

After trying a few variations I will need to stick with "0,0,0" for "window" and "base" to keep the AMOLED Black approach, but I can see what you mean regarding "alternatebase" and put together a new version of the GUI theme (some other tags were slightly tweaked for increased visibility as well):

[Main]
name        = Cyberpunk Night
description = A taste of the future 80's
author      = Anders Lemvigh
credit      = 
url         = https://github.com/alemvigh
license     = CC BY-SA 4.0
licenseurl  = https://creativecommons.org/licenses/by-sa/4.0/
icontheme   = typicons_dark

[Palette]
window          =   0,  0,  0
windowtext      = 150,150,150
base            =   0,  0,  0
alternatebase   =  30, 20, 45
text            = 150,150,150
tooltipbase     =  40, 20, 70
tooltiptext     = 255,255,255
button          =  5,  0,  10
buttontext      = 150,150,150
brighttext      = 255,255,255
highlight       =  50, 30, 80
highlightedtext = 255,255,255
link            =  77, 77,255
linkvisited     =  50,  0, 80

[GUI]
statusnone      =  50, 50, 50
statussaved     =  77,255, 77
statusunsaved   = 255, 77, 77

@vkbo
Copy link
Owner

vkbo commented Mar 6, 2024

Great! I'll test it out as well.

In version 2.4 there will also be the need for a colour for highlighted text in the syntax theme. The implementation only exists in the dev branch for now, here's an example entry:

https://github.com/vkbo/novelWriter/blob/dev/novelwriter/assets/syntax/tomorrow.conf

When 2.4 is ready, a highlight colour needs to be added to your syntax theme too. In 2.4 it will be possible to define an alpha channel colour as a fourth value in the theme files too.

@vkbo vkbo added the user interface Component: General user interface label Mar 7, 2024
@vkbo vkbo added this to the Release 2.3 milestone Mar 7, 2024
vkbo added a commit that referenced this issue Mar 9, 2024
@vkbo vkbo mentioned this issue Mar 9, 2024
6 tasks
@vkbo vkbo closed this as completed in #1738 Mar 9, 2024
@alemvigh
Copy link
Author

@vkbo Once you need updates for 2.4, could you please create an issue and assign it to me? Thanks!

@vkbo
Copy link
Owner

vkbo commented Mar 16, 2024

Sure, no problem. Do you mind just creating a fork of this repo and contribute it as a pull request? There may be future changes as well. I believe this is simple enough that you can edit the theme files directly on your fork of the repo on the GitHub website and don't need the full git setup on your computer to do it.

@alemvigh
Copy link
Author

I'll try to figure that out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Request: New feature or improvement user interface Component: General user interface
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants