Processing 4 IDE Editor Colours for Source Code

Started using Processing 4 recently and I’m having another go at a dark theme with helpful colouring of the code. The colour definitions have been moved from preferences.txt to theme.txt. This is better because Processing doesn’t keep overwriting the file, and the file can have comments.

I’ve tried to identify what each colours setting is for. This is moderately tedious because you have to restart Processing for each change. As I understand it, some parts of the code are coloured by specific settings, and the remaining are in the default editor colour. There are too many of these, e.g.:

There we have variables, brackets ()[], arithmetic operators, commas, semi-colons. All the same colour as defined by the foreground colour:

## PdeTextAreaDefaults - default colors for the editor ##

# foreground and background colors
editor.fgcolor = #00C0C0

I’ve tried tweaking all the code colours code as shown below. None affect the items in the image above. (I’m not suggesting the settings are a nice scheme, I’m still trying to find what controls what.)

  • Am I missing something.?
  • Is it possible to set different colours for those items?
  • I’ve had a glance at Token.java, doesn’t explain much to me.

The settings for the other code items are:

## Token - colors for source code in the editor ##
# For an explanation of these tags, see Token.java:
# processing/app/src/processing/app/syntax/Token.java

# functions (floor, sqrt, createWriter, frameRate, createFont, background
editor.token.function1.style = #9070D0,plain

# .format, else, flush close
editor.token.function2.style = #7000B0,plain

# if, while,
editor.token.function3.style = #00F080,plain

# else
editor.token.keyword3.style = #00F080,plain

# setup, draw
editor.token.function4.style = #FFFF00,bold

# true, false, break,
editor.token.keyword1.style = #0000FF,plain

# flush, size, .close, .format
editor.token.keyword2.style = #808000,plain

# frameCount
editor.token.keyword4.style = #80B000,plain

#data types: int, bold, boolean
editor.token.keyword5.style = #E06000,plain

# return
editor.token.keyword6.style = #9080E0,plain

#literals in "quotes"
editor.token.literal1.style = #00A0A0,plain

# CENTER, TOP
editor.token.literal2.style = #404080,plain

# Nothing?
editor.token.operator.style = #FF0000,BOLD

editor.token.label.style = #666666,bold
# Comments, block and line.

editor.token.comment1.style = #00FF00,plain
editor.token.comment2.style = #00FF00,plain

editor.token.invalid.style = #666666,bold
1 Like