Color themes

Two kinds of themes exist:

  • UI themes, file extension .cuda-theme-ui
  • Syntax themes, file extension .cuda-theme-syntax

Two dialogs allow to paint these kinds of themes. To paint a theme:

  • Call dialog: "Options/ Settings - more/ Settings - theme - nnnnn"
  • For UI themes: customize colors in dialog
  • For syntax themes: customize lexer-styles in dialog
  • For syntax themes: test theme at last on JS/HTML/CSS/C/Pascal/Ini/Markdown/Go lexers.
  • New theme files are saved in the subdir "data/themes"

Don't configure custom lexer styles in Lexer Properties dialog, if option "ui_lexer_themes" is on, because syntax-theme will override all your colors from that dialog. You can config these colors though, if option is off.

How to make theme package

  • Make such file "install.inf":
  1. [info]
  2. title=MyName UI theme (by AuthorName)
  3. type=cudatext-data
  4. subdir=themes
  5. homepage=https://github.com/nnnn/pppp
  • Make zip file "theme.MyName.zip" with files "MyTheme.cuda-theme-nnnnn" and "install.inf"
  • Test zip file: open zip file in CudaText, confirm installation
  • Publish file at forum or https://github.com/Alexey-T/CudaText/issues

How to see all UI theme items

  • "editor, font" - color of font when no lexer is active. Click statusbar field with lexer-name, call "none".
  • "editor, disabled state, font/bg" - editor shown with this bg-color when Replace dialog runs action, with option "confirm on replace" (during confirm message editor is disabled), if no lexer active
  • "statusbar alt" - shown on 2nd statusbar, run in console:
  1. msg_status_alt('dd', 8)
  • "search progressbar" - to see it, call Replace dlg, with regex, with confirmation (2 options in Replace dlg), replace "." (any char) to "www"
  • "editor, marked range bg" - shows for marked-range, to set marked range from line 5 to 10 use console:
  1. ed.set_prop(PROP_MARKED_RANGE, '5,10')
  • "editor, markers" - to see markers, call Commands dlg (F1), command "drop marker at caret".
  • "editor, separator lines" - lines show eg for lexer Pascal, above "function"/"procedure".
  • "listbox, …" - call Commands dlg (F1 key)
  • "listbox, …, auto-complete…" - call C or Pascal lexer, then press Ctrl+Space to call auto-completion (listbox has 3 columns, 3rd shows not for all items)
  • "splitters, main" - shown near Sidebar (vertical) and above Bottom panel (horizontal)
  • "splitters, groups" - shown between groups (vert/horz), activate 2-3 groups using "View" menu

Meaning of syntax-theme elements

  • Id: Normal id (identifier) or text.
  • Id1: Special id, used e.g. for class names (when it is mixed-case id) or const names (when it is upper-case id).
  • Id2: Special id, used e.g. for syntax constants (true, false, null…) and standard functions (sin, abs, max…).
  • Id3: Special id, used e.g. for measurement units (mm, Kb, px…) and preprocessor directives.
  • Id4: Special id, rarely used, e.g. Python uses it for function names after "def".
  • IdKeyword: Special id, used for syntax keywords.
  • IdVar: Variables, e.g. $name in PHP and Bash.
  • IdBad: Incorrect/misslepped id.
  • String: String literals.
  • String2: String literals, used e.g. for RegEx constants.
  • String3: String literals, one more kind, rarely used.
  • Symbol: Non-word symbols, ie brackets/punctuation/etc.
  • Symbol2: Non-word symbols, used when syntax needs another style for e.g. assignment/math operators.
  • SymbolBad: Incorrect non-word symbols.
  • Comment: Comments.
  • Comment2: Comments, used when syntax needs another style of comments, e.g. shebang in Bash.
  • CommentDoc: Documentation comments, ie comments which are parsed by special tools.
  • Number: Numbers (decimal, hex, octal, floating…).
  • Label: GoTo operator labels, or another special id.
  • Color: Color constants, like #RRGGBB in HTML/CSS.
  • IncludeBG#, SectionBG#: Styles which have background color set, and foreground color unset (none). Used to highlight function blocks, sub-lexer blocks, parts of a file, etc.
  • BracketBG: Style with background+foreground colors. Used to highlight paired brackets, begin/end keywords, repeat/until keywords (when "dynamic highlighting" option is on) etc.
  • CurBlockBG: Style with background color set, foreground color unset. Used to highlight block under caret, when "dynamic highlighting" option is on.
  • SeparLine: Color of horizontal 1-pixel separator lines. Was used before in Pascal, for lines above functions.
  • TagBound: HTML tags: angled brackets.
  • TagId: HTML tags: tag names.
  • TagIdBad: HTML tags: incorrect tag names.
  • TagProp: HTML tags: properties/attributes of tags, before "=" char.
  • TagPropBad: HTML tags: incorrect props/attrs of tags.
  • TagInclude: Tags used for inclusion of sub-lexer blocks. Used e.g. in PHP, .
  • LightBG#: Styles with bright background color, and normal foreground. Used e.g. in Diff to highlight deleted (LightBG1) / changed (LightBG2) / added (LightBG3) text blocks.
  • Pale#: Styles with pale (barely visible) foreground color. Rarely used.
  • TextBold: Style with bold font.
  • TextItalic: Style with italic font.
  • TextBoldItalic: Style with bold+italic font.
  • TextCross: Style with crossed/strikeout font.