WoW:API Frame SetBackdropColor: Difference between revisions

From AddOn Studio
Jump to navigation Jump to search
No edit summary
m (Move page script moved page API Frame SetBackdropColor to API Frame SetBackdropColor without leaving a redirect)
 
(4 intermediate revisions by 4 users not shown)
Line 1: Line 1:
<center>'''FontString:SetBackdropColor''' ''-Documentation by [[User:Gxam|Gxam]]-''</center>
{{widgetmethod}}


Set the color of the backdrop.
Allows you to set the color value, and alpha value used to tint the backdrop of a frame, as set by [[API Frame SetBackdrop|Frame:SetBackdrop]]([backdropTable]).


  someText:SetBackdropColor(red,green,blue,alpha)
  frame:SetBackdropColor(red,green,blue,alpha);
 
There are special considerations to be aware of when using this method. Specifically:
*The color value used here is meant to tint the backdrop file used in the backdrop of the frame. Tinting does not and cannot change the base color values of the file used, and as such tinting a black backdrop will have no effect whatsoever. Tinting black will always result in black anyway.
*Alpha values do not change the base alpha value of the file used as the backdrop. This setting does not and cannot change the base alpha channel of the image, so any alpha setting you use will be a modification of any alpha channels already present on the base image. Setting the alpha to 100% on an image with an alpha channel at 50%, will merely show the image with 50% opacity.


== Parameters ==
== Parameters ==
Line 10: Line 14:
:(red, green, blue, alpha)
:(red, green, blue, alpha)


:;red : Number - Range 0 to 1
:;red : Number - Range 0 to 1 (Darkest to Lightest)
:;green : Number - Range 0 to 1
:;green : Number - Range 0 to 1 (Darkest to Lightest)
:;blue : Number - Range 0 to 1
:;blue : Number - Range 0 to 1 (Darkest to Lightest)
:;alpha : Number - Range 0 to 1.  Optional.
:;alpha : Number - Range 0 to 1.  Optional. (Transparent to Opaque)


=== Returns ===
=== Returns ===
Nothing.
Nothing.


----
__NOTOC__
__NOTOC__
{{Template:WoW API}}

Latest revision as of 04:45, 15 August 2023

Widget API ← Frame < SetBackdropColor

Allows you to set the color value, and alpha value used to tint the backdrop of a frame, as set by Frame:SetBackdrop([backdropTable]).

frame:SetBackdropColor(red,green,blue,alpha);

There are special considerations to be aware of when using this method. Specifically:

  • The color value used here is meant to tint the backdrop file used in the backdrop of the frame. Tinting does not and cannot change the base color values of the file used, and as such tinting a black backdrop will have no effect whatsoever. Tinting black will always result in black anyway.
  • Alpha values do not change the base alpha value of the file used as the backdrop. This setting does not and cannot change the base alpha channel of the image, so any alpha setting you use will be a modification of any alpha channels already present on the base image. Setting the alpha to 100% on an image with an alpha channel at 50%, will merely show the image with 50% opacity.

Parameters[edit]

Arguments[edit]

(red, green, blue, alpha)
red
Number - Range 0 to 1 (Darkest to Lightest)
green
Number - Range 0 to 1 (Darkest to Lightest)
blue
Number - Range 0 to 1 (Darkest to Lightest)
alpha
Number - Range 0 to 1. Optional. (Transparent to Opaque)

Returns[edit]

Nothing.