BorderSetColor

Syntax

Success = BorderSetColor(Border, LeftColor.l, LeftOpacity.f, TopColor.l, TopOpacity.f, RightColor.l, RightOpacity.f, BottomColor.l, BottomOpacity.f)

Description

Sets the color and opacity for each side of a generated border object. This command is only applicable to borders created with CreateBorder().

Parameters

Border
The handle of the generated border object.

LeftColor.l
The color value for the left border side (use RGB()).

LeftOpacity.f
The opacity value (0.0 to 1.0) for the left border side.

TopColor.l
The color value for the top border side.

TopOpacity.f
The opacity value for the top border side.

RightColor.l
The color value for the right border side.

RightOpacity.f
The opacity value for the right border side.

BottomColor.l
The color value for the bottom border side.

BottomOpacity.f
The opacity value for the bottom border side.

Return Value

Returns #True if the values were successfully set, or #False if the border handle is invalid or not a generated border.

Remarks

This allows for fine-grained control over the appearance of each border side. For styles like 'groove', 'ridge', 'inset', and 'outset', the OS theme or internal logic might automatically shade the provided colors. Changing colors invalidates the border's rendering cache.

Example

IncludeFile "ProGUI_PB.pbi"

StartProGUI()

MyBorder = CreateBorder(#PG_Border_Solid, 5, 10, RGB(0, 0, 0), 1.0)

If MyBorder
  ; Set different colors for each side
  If BorderSetColor(MyBorder, RGB(255,0,0), 1.0, RGB(0,255,0), 1.0, RGB(0,0,255), 1.0, RGB(255,255,0), 0.5)
    Debug "Border colors set successfully."
  EndIf
  FreeBorder(MyBorder)
EndIf

StopProGUI()

See Also

CreateBorder, BorderGetColor, BorderSetWidth, BorderSetRadius, BorderSetFlags

Supported OS

Windows, Linux