@Override
  public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
    mImageView1 = view.findViewById(R.id.image1);
    mImageView2 = view.findViewById(R.id.image2);

    // Set a simple custom color resource as the image.
    // The format of custom_color1 is <color>#rrggbb</color>
    VitoView.show(UriUtil.getUriForResourceId(R.raw.custom_color1), CALLER_CONTEXT, mImageView1);
    VitoView.show(UriUtil.getUriForResourceId(R.raw.custom_color2), CALLER_CONTEXT, mImageView2);

    final SwitchCompat switchBackground = (SwitchCompat) view.findViewById(R.id.switch_background);
    switchBackground.setOnCheckedChangeListener(
        new CompoundButton.OnCheckedChangeListener() {
          @Override
          public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
            mImageView1.setBackground(isChecked ? new CheckerBoardDrawable(getResources()) : null);
            mImageView2.setBackground(isChecked ? new CheckerBoardDrawable(getResources()) : null);
          }
        });

    SwitchCompat switchCompat = (SwitchCompat) view.findViewById(R.id.decoder_switch);
    switchCompat.setChecked(
        CustomImageFormatConfigurator.isGlobalColorDecoderEnabled(getContext()));
    switchCompat.setOnCheckedChangeListener(
        new CompoundButton.OnCheckedChangeListener() {
          @Override
          public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
            CustomImageFormatConfigurator.setGlobalColorDecoderEnabled(getContext(), isChecked);
          }
        });
  }
Color XML example. It has a toggle to enable / disable Color XML support and displays 1 image.

<p>The supported XML color format is: <color>#rrggbb</color>
samples/showcase/src/main/java/com/facebook/fresco/samples/showcase/imageformat/color/ImageFormatColorFragment.java