ColorComponent Script: Difference between revisions

From the CreationKit Wiki
Jump to navigation Jump to search
imported>CraftySentinel
(Created ColorComponent Script)
 
m (Convert source tags to syntaxhighlight)
 
(17 intermediate revisions by 2 users not shown)
Line 1: Line 1:
__NOTOC__ __NOEDITSECTION__
'''Extends:''' None
'''Extends:''' None


'''Flags:''' [[Flag Reference|Hidden]]
Script for the manipulation of Color Codes.




Script for the manipulation of [[ColorForm]] components.
== Definition ==
<syntaxhighlight lang="papyrus">Scriptname ColorComponent Hidden</syntaxhighlight>
 


== Global SKSE Member Functions==
== Global SKSE Member Functions==


{|class="wikitable" width =100%
:'''Int [[GetAlpha - ColorComponent|GetAlpha]](Int ''argb'')'''
!style="text-align:left;" width=25%|Function
:*Gets the Alpha component Value from the specified Alpha-Red-Green-Blue(ARGB) code.
!style="text-align:left;"|Description
 
|-
:'''Int [[GetRed - ColorComponent|GetRed]](Int ''argb'')'''
|[[GetAlpha - ColorComponent|Int GetAlpha(Int)]]
:*Gets the Red component value from the specified ARGB color code.
|Returns the Alpha component of the [[ColorForm]].
 
|-
:'''Int [[GetGreen - ColorComponent|GetGreen]](Int ''argb'')'''
:*Gets the Green component value of the specified ARGB color code.
 
:'''Int [[GetBlue - ColorComponent|GetBlue]](Int ''argb'')'''
:*Gets the Blue component value of the specified ARGB color code.
 
:'''Float [[GetHue - ColorComponent|GetHue]](Int ''argb'')'''
:*Gets the Hue value of the specified ARGB, ranging from 0.0 to 360.0.
 
:'''Float [[GetSaturation - ColorComponent|GetSaturation]](Int ''argb'')'''
:*Gets the Saturation value of the specified ARGB color code.
 
:'''Float [[GetValue - ColorComponent|GetValue]](Int ''argb'')'''
:*Gets the Value of the specified ARGB color code, Value is also known as Brightness or Luminosity.
 
:'''Int [[SetAlpha - ColorComponent|SetAlpha]](Int ''argb'', Int ''a'')'''
:*Sets the Alpha component value of the specified ARGB color code to the specified amount.
 
:'''Int [[SetRed - ColorComponent|SetRed]](Int ''argb'', Int ''r'')'''
:*Sets the Red component value of the specified ARGB color code to the specified amount.
 
:'''Int [[SetGreen - ColorComponent|SetGreen]](Int ''argb'', Int ''g'')'''
:*Sets the Green component value of the specified ARGB color code to the specified amount.


|[[GetRed - ColorComponent|Int GetRed(Int)]]
:'''Int [[SetBlue - ColorComponent|SetBlue]](Int ''argb'', Int ''b'')'''
|Returns the red component of the [[ColorForm]].
:*Sets the Blue component value of the specified ARGB color code to the specified amount.
|-


|[[GetGreen - ColorComponent|Int GetGreen(Int)]]
:'''Int [[SetHue - ColorComponent|SetHue]](Int ''argb'', Float ''h'')'''
|Returns the Green component of the [[ColorForm]].
:*Sets the Hue value of the specified ARGB color code to the specified value.
|-


|[[GetBlue - ColorComponent|Int GetBlue(Int)]]
:'''Int [[SetSaturation - ColorComponent|SetSaturation]](Int ''argb'', Float ''s'')'''
|Returns the Blue component of the [[ColorForm]].
:*Sets the Saturation value of the specified ARGB color code to the specified value.
|-


|[[GetHue - ColorComponent|Float GetHue(Int)]]
:'''Int [[SetValue - ColorComponent|SetValue]](Int ''argb'', Float ''v'')'''
|Returns the hue component of the [[ColorForm]].
:*Sets the Value (Brightness) of the specified ARGB color code to the specified value.
|-


|[[GetSaturation - ColorComponent|Float GetSaturation(Int)]]
|Returns the Saturation component of the [[ColorForm]].
|-


|[[SetAlpha - ColorComponent|Int SetAlpha(Int, Int)]]
== Notes ==
|Sets the Alpha component of the [[ColorForm]].
|-


|[[SetRed - ColorComponent|Int SetRed(Int, Int)]]
*The bulk of the functions were  added by SKSE in 1.06.00, however  '''GetAlpha''' and '''SetAlpha''' were added in 1.06.02, while '''GetValue''' and '''SetValue''' were added in 1.06.03 replacing '''GetLuminosity''' and '''SetLuminosity'''.  
|Sets the Red component of the [[ColorForm]].
|-


|[[SetGreen - ColorComponent|Int SetGreen(Int, Int)]]
*The get functions (Excluding '''GetAlpha''' since ColorForms do not contain a alpha channel) within this script are used by functions of the same name contained within [[ColorForm Script]], to access the individual color components of a [[ColorForm]]'s ARGB.
|Sets the Green component of the [[ColorForm]].
|-


|[[SetBlue - ColorComponent|Int SetBlue(Int, Int)]]
*All ARGB color codes are Decimal conversions of Hex color codes. For example, a color code of 16777215 in Decimal is equivalent to #00FFFFFF in Hex (0 ,255, 255, 255 in ARGB values).
|Sets the Blue component of the [[ColorForm]].
|-


|[[SetHue - ColorComponent|Int SetHue(Int, Float)]]
|Sets the Hue component of the [[ColorForm]].
|-


|[[SetSaturation - ColorComponent|Int SetSaturation(Int, Float)]]
==See Also ==
|Sets the Saturation component of the [[ColorForm]].
*[[ColorForm Script]]
|-
*[[ColorForm]]


|}
[[Category:Papyrus]]
[[Category:SKSE]]
[[Category:SKSE Script Objects]]

Latest revision as of 20:55, 5 September 2026

Extends: None

Script for the manipulation of Color Codes.


Definition

Scriptname ColorComponent Hidden


Global SKSE Member Functions

Int GetAlpha(Int argb)
  • Gets the Alpha component Value from the specified Alpha-Red-Green-Blue(ARGB) code.
Int GetRed(Int argb)
  • Gets the Red component value from the specified ARGB color code.
Int GetGreen(Int argb)
  • Gets the Green component value of the specified ARGB color code.
Int GetBlue(Int argb)
  • Gets the Blue component value of the specified ARGB color code.
Float GetHue(Int argb)
  • Gets the Hue value of the specified ARGB, ranging from 0.0 to 360.0.
Float GetSaturation(Int argb)
  • Gets the Saturation value of the specified ARGB color code.
Float GetValue(Int argb)
  • Gets the Value of the specified ARGB color code, Value is also known as Brightness or Luminosity.
Int SetAlpha(Int argb, Int a)
  • Sets the Alpha component value of the specified ARGB color code to the specified amount.
Int SetRed(Int argb, Int r)
  • Sets the Red component value of the specified ARGB color code to the specified amount.
Int SetGreen(Int argb, Int g)
  • Sets the Green component value of the specified ARGB color code to the specified amount.
Int SetBlue(Int argb, Int b)
  • Sets the Blue component value of the specified ARGB color code to the specified amount.
Int SetHue(Int argb, Float h)
  • Sets the Hue value of the specified ARGB color code to the specified value.
Int SetSaturation(Int argb, Float s)
  • Sets the Saturation value of the specified ARGB color code to the specified value.
Int SetValue(Int argb, Float v)
  • Sets the Value (Brightness) of the specified ARGB color code to the specified value.


Notes

  • The bulk of the functions were added by SKSE in 1.06.00, however GetAlpha and SetAlpha were added in 1.06.02, while GetValue and SetValue were added in 1.06.03 replacing GetLuminosity and SetLuminosity.
  • The get functions (Excluding GetAlpha since ColorForms do not contain a alpha channel) within this script are used by functions of the same name contained within ColorForm Script, to access the individual color components of a ColorForm's ARGB.
  • All ARGB color codes are Decimal conversions of Hex color codes. For example, a color code of 16777215 in Decimal is equivalent to #00FFFFFF in Hex (0 ,255, 255, 255 in ARGB values).


See Also