-
Notifications
You must be signed in to change notification settings - Fork 6
How to control the color scheme
The CoordsysRenderer
in JPlotter supports the ColorScheme
API introduced in version 0.6.0.
This enables custom coloring of many of the visual elements of the CoordsysRenderer
.
Each ColorScheme
contains 6 (possibly) different colors (color1, color2, color3, color4, colorText & colorBackground), which are applied to different elements.
By default there are two color schemes included: Light and Dark by the DefaultColorScheme
.
A visual example of both of the color schemes:
Light: | Dark: |
---|---|
The ColorScheme
of the CoordSysRenderer
can be set by using one of the default color schemes as follows:
coordsys.setColorScheme(DefaultColorScheme.DARK.get());
coordsys.setColorScheme(DefaultColorScheme.LIGHT.get());
Custom color schemes are also supported. To use a custom color scheme, a ColorScheme
object has to be passed:
coordsys.setColorScheme(new ColorScheme(Color.BLACK, Color.DARK_GRAY, Color.LIGHT_GRAY, Color.WHITE, Color.RED));
Currently only the CoordSysRenderer supports the ColorScheme API, but other upcoming renderers that are similar to the CoordSysRenderer will also support the ColorScheme. This Wiki entry will then be updated.