You can change the visibility colors in several ways:

  • As the end user of a Lucy application, you can change the colors in the layer properties dialog box of the Observation Results layer.

  • You can change the default colors in the default style file. See the TLcyLspShapeVisibilityFormatAddOn.observationResults.defaultStyleFile property in the TLcyLspShapeVisibilityFormatAddOn configuration file.

  • As a developer, you can change the colors through the TLspIndexColorModelStyle exposed by the ILspCustomizableStyler used on the layer. You can modify the style to change the colors:

    //Retrieve the body styler from the observation results layer
    ILspCustomizableStyler styler = (ILspCustomizableStyler) aObservationResultsLayer.getStyler(TLspPaintRepresentationState.REGULAR_BODY);
    //Ask the styler for its styles, and find the index color model style
    Optional<TLspCustomizableStyle> customizableIndexColorModelStyle =
              .filter(customizableStyle -> customizableStyle.getStyle() instanceof TLspIndexColorModelStyle)
    //Update the colors in the index color model style
    customizableIndexColorModelStyle.ifPresent(customizableStyle -> {
      //Create a color map for the visibility values
      TLcdColorMap colorMap =
          new TLcdColorMap(new TLcdInterval(TLcyLspShapeVisibilityFormatAddOn.VISIBLE_VALUE - 1, TLcyLspShapeVisibilityFormatAddOn.NOT_COMPUTED_VALUE),
                           new double[]{TLcyLspShapeVisibilityFormatAddOn.VISIBLE_VALUE,
                           new Color[]{new Color(50, 255, 131, 128),
                                       new Color(221, 54, 34, 128),
                                       new Color(248, 255, 139, 128),
                                       new Color(255, 255, 255, 0),
                                       new Color(128, 128, 128, 128)});
      //Wrap the color map in a TLspIndexColorModelStyle
      TLspIndexColorModelStyle updatedStyle = TLspIndexColorModelStyle.newBuilder()
                                                                      .indexColorModel(new TLcdIndexColorModel(8, colorMap))
      //Update the style in the TLspCustomizableStyle