# PalVary (Kernel)

> PalVary manages transitions between the current palette and a new palette. It has a number of different subfunctions which will be described separately.

> Important

> SCI1.1 only.

`PalVary`(pvINIT resourceNumber ticks [stepStop direction])

  Begins a transition to a new palette. This only needs to be called once.

  Parameters: | resourceNumber (number) – The palette resource number. ticks (number) – The number of ticks between each step in the transition (60 ticks is one second). stepStop (number) – How far along the transition to go, ranging from 0-64, where 64 is the complete transition. The default is 64. direction (number) – 1 for forward, -1 for reverse.

  Example:

      (PalVary pvINIT targetPalette 1 64 3)

`PalVary`(pvUNINIT)

  Stops a palette transition. Before performing other palette effects, an existing transition must be stopped.

  Example:

      (method (doit)
              (super doit:)
              (if (== 64 (PalVary pvGET_CURRENT_STEP))
                      (PalVary pvUNINIT)
                      ; The transition is now done...
              )
      )

`PalVary`(pvREVERSE [ticks stepStop direction])

  Reverses an existing palette transition.

  Parameters: | ticks (number) – The number of ticks between each step in the transition (60 ticks is one second). stepStop (number) – How far along the transition to go, ranging from 1-64, where 64 is the complete transition. direction (number) – 1 for forward, -1 for reverse.

`PalVary`(pvGET_CURRENT_STEP)

  Returns the current step of the transition, ranging between 0 and 64. 64 indicates the transition is complete.

  Returns: | The current step (between 0 and 64).

`PalVary`(pvCHANGE_TARGET resourceNumber)

  Changes the target palette of the transition.

  Parameters: | resourceNumber (number) – The palette resource number.

`PalVary`(pvCHANGE_TICKS ticks)

  Sets the number of ticks between each step of the palette transition.

  Parameters: | ticks (number) – The number of ticks between each step in the transition (60 ticks is one second).

`PalVary`(pvPAUSE_RESUME fPause)

  Pauses or resumes a palette transition.

  Parameters: | fPause (boolean) – If TRUE, the transition is paused. If FALSE, the transtion is resumed.