.. highlightlang:: us .. index:: OBJSetColorGradient .. _objsetcolorgradient: OBJSetColorGradient =================== .. us.tag OBJSetColorGradient ENGLISH draw-set Changed6002 :ref:`OBJSetColorGradient` sets the color for a color gradient for a drawing object or a diagram. .. function:: bool = OBJSetColorGradient(hobj, rvRGB1, rvRGB2) bool = OBJSetColorGradient(hobj, rvARGB1, rvARGB2) .. us.return **Return Value** If the function succeeds, the return value *bool* is TRUE (1); otherwise it is FALSE (0). .. us.params **Parameters** .. uparam:: hobj *hobj* identifies a line, text, rectangle, ellipse or layer (diagram) object. .. uparam:: rvRGB1 is a vector with 3 elements: .. list-table:: :header-rows: 1 * - Value - Meaning * - rvRGB1[1] - (Bottom) Red (0 to 255) * - rvRGB1[2] - (Bottom) Green (0 to 255) * - rvRGB1[3] - (Bottom) Blue (0 to 255) .. uparam:: rvRGB2 is a vector with 3 elements: .. list-table:: :header-rows: 1 * - Value - Meaning * - rvRGB2[1] - (Top) Red (0 to 255) * - rvRGB2[2] - (Top) Green (0 to 255) * - rvRGB2[3] - (Top) Blue (0 to 255) .. uparam:: rvARGB1 *rvARGB1* is a vector with 4 elements for the bottom color: .. list-table:: :header-rows: 1 * - Value - Meaning * - rvARGB1[1] - Alpha: 0 = Transparent, 255 = Opaque * - rvARGB1[2] - Red (0-255) * - rvARGB1[3] - Green (0-255) * - rvARGB1[4] - Blue (0-255) .. uparam:: rvARGB2 *rvARGB2* is a vector with 4 elements for the top color: .. list-table:: :header-rows: 1 * - Value - Meaning * - rvARGB1[1] - Alpha: 0 = Transparent, 255 = Opaque * - rvARGB2[2] - Red (0-255) * - rvARGB3[3] - Green (0-255) * - rvARGB4[4] - Blue (0-255) .. us.example **Example** :: hRB = RBCreate(); // Create Rectangle OBJSetBkMode(hRB, OPAQUE); OBJSetFillMode(hRB, 1); // Color Gradient OBJSetColorGradient(hRB, [0,0,0], [255,255,255]); **History** .. list-table:: :header-rows: 1 * - Version - Description * - R2018.2 - Transparency. .. seealso:: :ref:`overview-drawing-objects`, :ref:`OBJGetColorGradient` :sub:`id-824681`