Difference between revisions of "RED"

From QB64 Wiki
Jump to navigation Jump to search
imported>Odin
(Redirected page to Color Components)
imported>SMcNeill
(style guidelines)
Line 1: Line 1:
#REDIRECT [[Color Components]]
{{DISPLAYTITLE:_RED}}
The [[_RED]] function returns the palette index or the red component intensity of a 32-bit image color.
 
 
{{PageSyntax}}
: {{Parameter|redIntensity&}} = [[_RED]]({{Parameter|rgbaColorIndex&}}[, {{Parameter|imageHandle&}}])
 
 
{{PageDescription}}
* {{Parameter|rgbaColorIndex&}} is the ''RGBA'' color value or palette index of the color to retrieve the red component intensity from.
* The [[LONG]] intensity value returned ranges from 0 (no intensity, not present) to 255 (full intensity).
* {{Parameter|imageHandle&}} is optional.
* If {{Parameter|imageHandle&}} specifies a 32-bit color image, {{Parameter|rgbaColorIndex&}} is interpreted as a 32-bit ''RGBA'' color value.
* If {{Parameter|imageHandle&}} specifies an image that uses a palette, {{Parameter|rgbaColorIndex&}} is interpreted as a palette index.
* If {{Parameter|imageHandle&}} is not specified, it is assumed to be the current write page.
* If {{Parameter|imageHandle&}} is an invalid handle, an [[ERROR Codes|invalid handle]] error occurs.
* If {{Parameter|rgbaColorIndex&}} is outside the range of valid indexes for a given image mode, an [[ERROR Codes|illegal function call]] error occurs.
* Uses index parameters passed by the [[_RGB]], [[_RGBA]], [[_RGB32]] or [[_RGBA32]] functions.
 
 
{{PageExamples]]
* See the example in [[POINT]].
 
 
{{PageSeeAlso}}
* [[_GREEN]], [[_BLUE]]
* [[_RGB]], [[RGB32]]
* [[_LOADIMAGE]]
 
 
{{PageNavigation}}

Revision as of 21:28, 8 September 2017

The _RED function returns the palette index or the red component intensity of a 32-bit image color.


Syntax

redIntensity& = _RED(rgbaColorIndex&[, imageHandle&])


Description

  • rgbaColorIndex& is the RGBA color value or palette index of the color to retrieve the red component intensity from.
  • The LONG intensity value returned ranges from 0 (no intensity, not present) to 255 (full intensity).
  • imageHandle& is optional.
  • If imageHandle& specifies a 32-bit color image, rgbaColorIndex& is interpreted as a 32-bit RGBA color value.
  • If imageHandle& specifies an image that uses a palette, rgbaColorIndex& is interpreted as a palette index.
  • If imageHandle& is not specified, it is assumed to be the current write page.
  • If imageHandle& is an invalid handle, an invalid handle error occurs.
  • If rgbaColorIndex& is outside the range of valid indexes for a given image mode, an illegal function call error occurs.
  • Uses index parameters passed by the _RGB, _RGBA, _RGB32 or _RGBA32 functions.


{{PageExamples]]

  • See the example in POINT.


See also



Navigation:
Keyword Reference - Alphabetical
Keyword Reference - By Usage
Main Wiki Page