# How to change solid color to anther type in C++?

**URL:** https://discourse.paraview.org/t/how-to-change-solid-color-to-anther-type-in-c/11982
**Category:** Development
**Created:** [April 28, 2023, 11:25am UTC](https://discourse.paraview.org/t/how-to-change-solid-color-to-anther-type-in-c/11982 "2023-04-28T11:25:46Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![DG\_Kang](https://discourse.paraview.org/user_avatar/discourse.paraview.org/dg_kang/32/11352_2.png) [@DG\_Kang](https://discourse.paraview.org/u/DG_Kang)
#### Post date: [April 28, 2023, 11:25am UTC](https://discourse.paraview.org/t/how-to-change-solid-color-to-anther-type-in-c/11982/1 "2023-04-28T11:25:46Z")

</div>

Hi, I need to modify the “Idp” variable to a Solid Color within this combo select feature using C++.

 ![Quicker_20230428_185652](https://discourse.paraview.org/uploads/default/original/2X/4/467e5df59e43460b870edc67455ff14f1920bb3e.png)

Here’s the code I use to adjust the transparency and color.

```auto
QVector<pqPipelineSource *> QSourcePointer = pqLoadDataReaction::loadFilesForSupportedTypes(filelist);
pqDataRepresentation* repre = QSourcePointer.at(0)->getRepresentation(QSourcePointer.at(0)->getViews().at(0));
vtkSMPropertyHelper(repre->getProxy(), "Opacity").Set(0.3);
double white[3] = {1.0, 1.0, 1.0};
vtkSMPropertyHelper(repre->getProxy(), "DiffuseColor").Set(white, 3);

```

I find something that might be helpful in _pv\Remoting\Views\Resources\views\_and\_representations.xml_ and _pqDisplayColorWidget.cxx_

```auto
      <StringVectorProperty command="SetInputArrayToProcess"
                            element_types="0 0 0 0 2"
                            name="ColorArrayName"
                            number_of_elements="5">
        <Documentation>
          Set the array to color with. One must specify the field association and
          the array name of the array. If the array is missing, scalar coloring will
          automatically be disabled.
        </Documentation>
        <RepresentedArrayListDomain name="array_list"
                         input_domain_name="input_array_any">
          <RequiredProperties>
            <Property function="Input" name="Input" />
          </RequiredProperties>
        </RepresentedArrayListDomain>
      </StringVectorProperty>

```

I attempted to use this code, but unfortunately, it did not work.

```auto
vtkSMPropertyHelper(repre->getProxy(), "ColorArrayName").Set("Solid Color");

```

---

<div class="post-metadata">

### Author: ![DG\_Kang](https://discourse.paraview.org/user_avatar/discourse.paraview.org/dg_kang/32/11352_2.png) [@DG\_Kang](https://discourse.paraview.org/u/DG_Kang)
#### Post date: [May 6, 2023, 6:06am UTC](https://discourse.paraview.org/t/how-to-change-solid-color-to-anther-type-in-c/11982/2 "2023-05-06T06:06:38Z")

</div>

This code solved my problem.

```auto
vtkSMPVRepresentationProxy::SetScalarColoring(repre->getProxy(), "", vtkDataObject::POINT);

```
