.. role:: ts-api-decorator

##########
Background
##########

.. js:module:: cee
   :noindex:

.. container:: ts-api-section

   .. js:class:: Background

      Background configuration

      The class defines the view background settings. The background can either be single colored or 
      be a gradient between a top and a bottom color. 
      Image backgrounds are also supported, in which case the image will be rendered on top of the 
      specified background color.

      You can access the background object from the view with the ``View.background`` property.



.. container:: api-index-section

   .. rubric:: Accessors

   .. rst-class:: api-index-list-item api-kind-accessor api-parent-kind-class

   * :js:attr:`~cee.Background.bottomColor`
   * :js:attr:`~cee.Background.image`
   * :js:attr:`~cee.Background.topColor`



.. container:: api-index-section

   .. rubric:: Methods

   .. rst-class:: api-index-list-item api-kind-method api-parent-kind-class

   * :js:meth:`~cee.Background.setImage`
   * :js:meth:`~cee.Background.setSingleColor`
   * :js:meth:`~cee.Background.setTopAndBottomColor`





------------

Accessors
=========

.. container:: ts-api-section

   .. js:function:: Background.bottomColor()



      The bottom color of the background. 

      If background is single color, the topColor and bottomColor properties are equal


      :rtype: Color4



.. container:: ts-api-section

   .. js:function:: Background.image()



      If image background is in use it returns the image uses as a background.


      :rtype: Texture



.. container:: ts-api-section

   .. js:function:: Background.topColor()



      The top color of the background. 

      If background is single color, the topColor and bottomColor properties are equal


      :rtype: Color4



Methods
=======

.. rst-class:: ts-api-section

setImage
--------

.. js:method:: Background.setImage( texture)

   :param texture: None
   :type texture: Texture


   Use the given image as the background of the view

   Specify null to clear any previously specified background image.


   :rtype: void

.. rst-class:: ts-api-section

setSingleColor
--------------

.. js:method:: Background.setSingleColor( color)

   :param color: None
   :type color: Color4Like


   Sets the background color to the given color (single color) 

   The background of the view will be cleared with the given color, and no graded background will
   be rendered. This is the default mode.


   :rtype: void

.. rst-class:: ts-api-section

setTopAndBottomColor
--------------------

.. js:method:: Background.setTopAndBottomColor( topColor, bottomColor)

   :param topColor: None
   :type topColor: Color4Like
   :param bottomColor: None
   :type bottomColor: Color4Like


   Sets the background color to a gradient defined by a top color and a bottom color


   :rtype: void

