class_color.rst 85 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472
  1. :github_url: hide
  2. .. DO NOT EDIT THIS FILE!!!
  3. .. Generated automatically from Godot engine sources.
  4. .. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
  5. .. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/Color.xml.
  6. .. _class_Color:
  7. Color
  8. =====
  9. A color represented in RGBA format.
  10. .. rst-class:: classref-introduction-group
  11. Description
  12. -----------
  13. A color represented in RGBA format by a red (:ref:`r<class_Color_property_r>`), green (:ref:`g<class_Color_property_g>`), blue (:ref:`b<class_Color_property_b>`), and alpha (:ref:`a<class_Color_property_a>`) component. Each component is a 32-bit floating-point value, usually ranging from ``0.0`` to ``1.0``. Some properties (such as :ref:`CanvasItem.modulate<class_CanvasItem_property_modulate>`) may support values greater than ``1.0``, for overbright or HDR (High Dynamic Range) colors.
  14. Colors can be created in a number of ways: By the various **Color** constructors, by static methods such as :ref:`from_hsv()<class_Color_method_from_hsv>`, and by using a name from the set of standardized colors based on `X11 color names <https://en.wikipedia.org/wiki/X11_color_names>`__ with the addition of :ref:`TRANSPARENT<class_Color_constant_TRANSPARENT>`. GDScript also provides :ref:`@GDScript.Color8()<class_@GDScript_method_Color8>`, which uses integers from ``0`` to ``255`` and doesn't support overbright colors.
  15. \ `Color constants cheatsheet <https://raw.githubusercontent.com/godotengine/godot-docs/master/img/color_constants.png>`__\
  16. Although **Color** may be used to store values of any encoding, the red (:ref:`r<class_Color_property_r>`), green (:ref:`g<class_Color_property_g>`), and blue (:ref:`b<class_Color_property_b>`) properties of **Color** are expected by Godot to be encoded using the `nonlinear sRGB transfer function <https://en.wikipedia.org/wiki/SRGB#Transfer_function_(%22gamma%22)>`__ unless otherwise stated. This color encoding is used by many traditional art and web tools, making it easy to match colors between Godot and these tools. Godot uses `Rec. ITU-R BT.709 <https://en.wikipedia.org/wiki/Rec._709>`__ color primaries, which are used by the sRGB standard.
  17. All physical simulation, such as lighting calculations, and colorimetry transformations, such as :ref:`get_luminance()<class_Color_method_get_luminance>`, must be performed on linearly encoded values to produce correct results. When performing these calculations, convert **Color** to and from linear encoding using :ref:`srgb_to_linear()<class_Color_method_srgb_to_linear>` and :ref:`linear_to_srgb()<class_Color_method_linear_to_srgb>`.
  18. \ **Note:** In a boolean context, a Color will evaluate to ``false`` if it is equal to ``Color(0, 0, 0, 1)`` (opaque black). Otherwise, a Color will always evaluate to ``true``.
  19. .. note::
  20. There are notable differences when using this API with C#. See :ref:`doc_c_sharp_differences` for more information.
  21. .. rst-class:: classref-introduction-group
  22. Tutorials
  23. ---------
  24. - `2D GD Paint Demo <https://godotengine.org/asset-library/asset/2768>`__
  25. - `Tween Interpolation Demo <https://godotengine.org/asset-library/asset/2733>`__
  26. - `GUI Drag And Drop Demo <https://godotengine.org/asset-library/asset/2767>`__
  27. .. rst-class:: classref-reftable-group
  28. Properties
  29. ----------
  30. .. table::
  31. :widths: auto
  32. +---------------------------+------------------------------------------------+---------+
  33. | :ref:`float<class_float>` | :ref:`a<class_Color_property_a>` | ``1.0`` |
  34. +---------------------------+------------------------------------------------+---------+
  35. | :ref:`int<class_int>` | :ref:`a8<class_Color_property_a8>` | ``255`` |
  36. +---------------------------+------------------------------------------------+---------+
  37. | :ref:`float<class_float>` | :ref:`b<class_Color_property_b>` | ``0.0`` |
  38. +---------------------------+------------------------------------------------+---------+
  39. | :ref:`int<class_int>` | :ref:`b8<class_Color_property_b8>` | ``0`` |
  40. +---------------------------+------------------------------------------------+---------+
  41. | :ref:`float<class_float>` | :ref:`g<class_Color_property_g>` | ``0.0`` |
  42. +---------------------------+------------------------------------------------+---------+
  43. | :ref:`int<class_int>` | :ref:`g8<class_Color_property_g8>` | ``0`` |
  44. +---------------------------+------------------------------------------------+---------+
  45. | :ref:`float<class_float>` | :ref:`h<class_Color_property_h>` | ``0.0`` |
  46. +---------------------------+------------------------------------------------+---------+
  47. | :ref:`float<class_float>` | :ref:`ok_hsl_h<class_Color_property_ok_hsl_h>` | ``0.0`` |
  48. +---------------------------+------------------------------------------------+---------+
  49. | :ref:`float<class_float>` | :ref:`ok_hsl_l<class_Color_property_ok_hsl_l>` | ``0.0`` |
  50. +---------------------------+------------------------------------------------+---------+
  51. | :ref:`float<class_float>` | :ref:`ok_hsl_s<class_Color_property_ok_hsl_s>` | ``0.0`` |
  52. +---------------------------+------------------------------------------------+---------+
  53. | :ref:`float<class_float>` | :ref:`r<class_Color_property_r>` | ``0.0`` |
  54. +---------------------------+------------------------------------------------+---------+
  55. | :ref:`int<class_int>` | :ref:`r8<class_Color_property_r8>` | ``0`` |
  56. +---------------------------+------------------------------------------------+---------+
  57. | :ref:`float<class_float>` | :ref:`s<class_Color_property_s>` | ``0.0`` |
  58. +---------------------------+------------------------------------------------+---------+
  59. | :ref:`float<class_float>` | :ref:`v<class_Color_property_v>` | ``0.0`` |
  60. +---------------------------+------------------------------------------------+---------+
  61. .. rst-class:: classref-reftable-group
  62. Constructors
  63. ------------
  64. .. table::
  65. :widths: auto
  66. +---------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  67. | :ref:`Color<class_Color>` | :ref:`Color<class_Color_constructor_Color>`\ (\ ) |
  68. +---------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  69. | :ref:`Color<class_Color>` | :ref:`Color<class_Color_constructor_Color>`\ (\ from\: :ref:`Color<class_Color>`, alpha\: :ref:`float<class_float>`\ ) |
  70. +---------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  71. | :ref:`Color<class_Color>` | :ref:`Color<class_Color_constructor_Color>`\ (\ from\: :ref:`Color<class_Color>`\ ) |
  72. +---------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  73. | :ref:`Color<class_Color>` | :ref:`Color<class_Color_constructor_Color>`\ (\ code\: :ref:`String<class_String>`\ ) |
  74. +---------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  75. | :ref:`Color<class_Color>` | :ref:`Color<class_Color_constructor_Color>`\ (\ code\: :ref:`String<class_String>`, alpha\: :ref:`float<class_float>`\ ) |
  76. +---------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  77. | :ref:`Color<class_Color>` | :ref:`Color<class_Color_constructor_Color>`\ (\ r\: :ref:`float<class_float>`, g\: :ref:`float<class_float>`, b\: :ref:`float<class_float>`\ ) |
  78. +---------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  79. | :ref:`Color<class_Color>` | :ref:`Color<class_Color_constructor_Color>`\ (\ r\: :ref:`float<class_float>`, g\: :ref:`float<class_float>`, b\: :ref:`float<class_float>`, a\: :ref:`float<class_float>`\ ) |
  80. +---------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  81. .. rst-class:: classref-reftable-group
  82. Methods
  83. -------
  84. .. table::
  85. :widths: auto
  86. +-----------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  87. | :ref:`Color<class_Color>` | :ref:`blend<class_Color_method_blend>`\ (\ over\: :ref:`Color<class_Color>`\ ) |const| |
  88. +-----------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  89. | :ref:`Color<class_Color>` | :ref:`clamp<class_Color_method_clamp>`\ (\ min\: :ref:`Color<class_Color>` = Color(0, 0, 0, 0), max\: :ref:`Color<class_Color>` = Color(1, 1, 1, 1)\ ) |const| |
  90. +-----------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  91. | :ref:`Color<class_Color>` | :ref:`darkened<class_Color_method_darkened>`\ (\ amount\: :ref:`float<class_float>`\ ) |const| |
  92. +-----------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  93. | :ref:`Color<class_Color>` | :ref:`from_hsv<class_Color_method_from_hsv>`\ (\ h\: :ref:`float<class_float>`, s\: :ref:`float<class_float>`, v\: :ref:`float<class_float>`, alpha\: :ref:`float<class_float>` = 1.0\ ) |static| |
  94. +-----------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  95. | :ref:`Color<class_Color>` | :ref:`from_ok_hsl<class_Color_method_from_ok_hsl>`\ (\ h\: :ref:`float<class_float>`, s\: :ref:`float<class_float>`, l\: :ref:`float<class_float>`, alpha\: :ref:`float<class_float>` = 1.0\ ) |static| |
  96. +-----------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  97. | :ref:`Color<class_Color>` | :ref:`from_rgba8<class_Color_method_from_rgba8>`\ (\ r8\: :ref:`int<class_int>`, g8\: :ref:`int<class_int>`, b8\: :ref:`int<class_int>`, a8\: :ref:`int<class_int>` = 255\ ) |static| |
  98. +-----------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  99. | :ref:`Color<class_Color>` | :ref:`from_rgbe9995<class_Color_method_from_rgbe9995>`\ (\ rgbe\: :ref:`int<class_int>`\ ) |static| |
  100. +-----------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  101. | :ref:`Color<class_Color>` | :ref:`from_string<class_Color_method_from_string>`\ (\ str\: :ref:`String<class_String>`, default\: :ref:`Color<class_Color>`\ ) |static| |
  102. +-----------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  103. | :ref:`float<class_float>` | :ref:`get_luminance<class_Color_method_get_luminance>`\ (\ ) |const| |
  104. +-----------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  105. | :ref:`Color<class_Color>` | :ref:`hex<class_Color_method_hex>`\ (\ hex\: :ref:`int<class_int>`\ ) |static| |
  106. +-----------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  107. | :ref:`Color<class_Color>` | :ref:`hex64<class_Color_method_hex64>`\ (\ hex\: :ref:`int<class_int>`\ ) |static| |
  108. +-----------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  109. | :ref:`Color<class_Color>` | :ref:`html<class_Color_method_html>`\ (\ rgba\: :ref:`String<class_String>`\ ) |static| |
  110. +-----------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  111. | :ref:`bool<class_bool>` | :ref:`html_is_valid<class_Color_method_html_is_valid>`\ (\ color\: :ref:`String<class_String>`\ ) |static| |
  112. +-----------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  113. | :ref:`Color<class_Color>` | :ref:`inverted<class_Color_method_inverted>`\ (\ ) |const| |
  114. +-----------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  115. | :ref:`bool<class_bool>` | :ref:`is_equal_approx<class_Color_method_is_equal_approx>`\ (\ to\: :ref:`Color<class_Color>`\ ) |const| |
  116. +-----------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  117. | :ref:`Color<class_Color>` | :ref:`lerp<class_Color_method_lerp>`\ (\ to\: :ref:`Color<class_Color>`, weight\: :ref:`float<class_float>`\ ) |const| |
  118. +-----------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  119. | :ref:`Color<class_Color>` | :ref:`lightened<class_Color_method_lightened>`\ (\ amount\: :ref:`float<class_float>`\ ) |const| |
  120. +-----------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  121. | :ref:`Color<class_Color>` | :ref:`linear_to_srgb<class_Color_method_linear_to_srgb>`\ (\ ) |const| |
  122. +-----------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  123. | :ref:`Color<class_Color>` | :ref:`srgb_to_linear<class_Color_method_srgb_to_linear>`\ (\ ) |const| |
  124. +-----------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  125. | :ref:`int<class_int>` | :ref:`to_abgr32<class_Color_method_to_abgr32>`\ (\ ) |const| |
  126. +-----------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  127. | :ref:`int<class_int>` | :ref:`to_abgr64<class_Color_method_to_abgr64>`\ (\ ) |const| |
  128. +-----------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  129. | :ref:`int<class_int>` | :ref:`to_argb32<class_Color_method_to_argb32>`\ (\ ) |const| |
  130. +-----------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  131. | :ref:`int<class_int>` | :ref:`to_argb64<class_Color_method_to_argb64>`\ (\ ) |const| |
  132. +-----------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  133. | :ref:`String<class_String>` | :ref:`to_html<class_Color_method_to_html>`\ (\ with_alpha\: :ref:`bool<class_bool>` = true\ ) |const| |
  134. +-----------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  135. | :ref:`int<class_int>` | :ref:`to_rgba32<class_Color_method_to_rgba32>`\ (\ ) |const| |
  136. +-----------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  137. | :ref:`int<class_int>` | :ref:`to_rgba64<class_Color_method_to_rgba64>`\ (\ ) |const| |
  138. +-----------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  139. .. rst-class:: classref-reftable-group
  140. Operators
  141. ---------
  142. .. table::
  143. :widths: auto
  144. +---------------------------+---------------------------------------------------------------------------------------------+
  145. | :ref:`bool<class_bool>` | :ref:`operator !=<class_Color_operator_neq_Color>`\ (\ right\: :ref:`Color<class_Color>`\ ) |
  146. +---------------------------+---------------------------------------------------------------------------------------------+
  147. | :ref:`Color<class_Color>` | :ref:`operator *<class_Color_operator_mul_Color>`\ (\ right\: :ref:`Color<class_Color>`\ ) |
  148. +---------------------------+---------------------------------------------------------------------------------------------+
  149. | :ref:`Color<class_Color>` | :ref:`operator *<class_Color_operator_mul_float>`\ (\ right\: :ref:`float<class_float>`\ ) |
  150. +---------------------------+---------------------------------------------------------------------------------------------+
  151. | :ref:`Color<class_Color>` | :ref:`operator *<class_Color_operator_mul_int>`\ (\ right\: :ref:`int<class_int>`\ ) |
  152. +---------------------------+---------------------------------------------------------------------------------------------+
  153. | :ref:`Color<class_Color>` | :ref:`operator +<class_Color_operator_sum_Color>`\ (\ right\: :ref:`Color<class_Color>`\ ) |
  154. +---------------------------+---------------------------------------------------------------------------------------------+
  155. | :ref:`Color<class_Color>` | :ref:`operator -<class_Color_operator_dif_Color>`\ (\ right\: :ref:`Color<class_Color>`\ ) |
  156. +---------------------------+---------------------------------------------------------------------------------------------+
  157. | :ref:`Color<class_Color>` | :ref:`operator /<class_Color_operator_div_Color>`\ (\ right\: :ref:`Color<class_Color>`\ ) |
  158. +---------------------------+---------------------------------------------------------------------------------------------+
  159. | :ref:`Color<class_Color>` | :ref:`operator /<class_Color_operator_div_float>`\ (\ right\: :ref:`float<class_float>`\ ) |
  160. +---------------------------+---------------------------------------------------------------------------------------------+
  161. | :ref:`Color<class_Color>` | :ref:`operator /<class_Color_operator_div_int>`\ (\ right\: :ref:`int<class_int>`\ ) |
  162. +---------------------------+---------------------------------------------------------------------------------------------+
  163. | :ref:`bool<class_bool>` | :ref:`operator ==<class_Color_operator_eq_Color>`\ (\ right\: :ref:`Color<class_Color>`\ ) |
  164. +---------------------------+---------------------------------------------------------------------------------------------+
  165. | :ref:`float<class_float>` | :ref:`operator []<class_Color_operator_idx_int>`\ (\ index\: :ref:`int<class_int>`\ ) |
  166. +---------------------------+---------------------------------------------------------------------------------------------+
  167. | :ref:`Color<class_Color>` | :ref:`operator unary+<class_Color_operator_unplus>`\ (\ ) |
  168. +---------------------------+---------------------------------------------------------------------------------------------+
  169. | :ref:`Color<class_Color>` | :ref:`operator unary-<class_Color_operator_unminus>`\ (\ ) |
  170. +---------------------------+---------------------------------------------------------------------------------------------+
  171. .. rst-class:: classref-section-separator
  172. ----
  173. .. rst-class:: classref-descriptions-group
  174. Constants
  175. ---------
  176. .. _class_Color_constant_ALICE_BLUE:
  177. .. rst-class:: classref-constant
  178. **ALICE_BLUE** = ``Color(0.9411765, 0.972549, 1, 1)`` :ref:`🔗<class_Color_constant_ALICE_BLUE>`
  179. Alice blue color.
  180. .. _class_Color_constant_ANTIQUE_WHITE:
  181. .. rst-class:: classref-constant
  182. **ANTIQUE_WHITE** = ``Color(0.98039216, 0.92156863, 0.84313726, 1)`` :ref:`🔗<class_Color_constant_ANTIQUE_WHITE>`
  183. Antique white color.
  184. .. _class_Color_constant_AQUA:
  185. .. rst-class:: classref-constant
  186. **AQUA** = ``Color(0, 1, 1, 1)`` :ref:`🔗<class_Color_constant_AQUA>`
  187. Aqua color.
  188. .. _class_Color_constant_AQUAMARINE:
  189. .. rst-class:: classref-constant
  190. **AQUAMARINE** = ``Color(0.49803922, 1, 0.83137256, 1)`` :ref:`🔗<class_Color_constant_AQUAMARINE>`
  191. Aquamarine color.
  192. .. _class_Color_constant_AZURE:
  193. .. rst-class:: classref-constant
  194. **AZURE** = ``Color(0.9411765, 1, 1, 1)`` :ref:`🔗<class_Color_constant_AZURE>`
  195. Azure color.
  196. .. _class_Color_constant_BEIGE:
  197. .. rst-class:: classref-constant
  198. **BEIGE** = ``Color(0.9607843, 0.9607843, 0.8627451, 1)`` :ref:`🔗<class_Color_constant_BEIGE>`
  199. Beige color.
  200. .. _class_Color_constant_BISQUE:
  201. .. rst-class:: classref-constant
  202. **BISQUE** = ``Color(1, 0.89411765, 0.76862746, 1)`` :ref:`🔗<class_Color_constant_BISQUE>`
  203. Bisque color.
  204. .. _class_Color_constant_BLACK:
  205. .. rst-class:: classref-constant
  206. **BLACK** = ``Color(0, 0, 0, 1)`` :ref:`🔗<class_Color_constant_BLACK>`
  207. Black color. In GDScript, this is the default value of any color.
  208. .. _class_Color_constant_BLANCHED_ALMOND:
  209. .. rst-class:: classref-constant
  210. **BLANCHED_ALMOND** = ``Color(1, 0.92156863, 0.8039216, 1)`` :ref:`🔗<class_Color_constant_BLANCHED_ALMOND>`
  211. Blanched almond color.
  212. .. _class_Color_constant_BLUE:
  213. .. rst-class:: classref-constant
  214. **BLUE** = ``Color(0, 0, 1, 1)`` :ref:`🔗<class_Color_constant_BLUE>`
  215. Blue color.
  216. .. _class_Color_constant_BLUE_VIOLET:
  217. .. rst-class:: classref-constant
  218. **BLUE_VIOLET** = ``Color(0.5411765, 0.16862746, 0.8862745, 1)`` :ref:`🔗<class_Color_constant_BLUE_VIOLET>`
  219. Blue violet color.
  220. .. _class_Color_constant_BROWN:
  221. .. rst-class:: classref-constant
  222. **BROWN** = ``Color(0.64705884, 0.16470589, 0.16470589, 1)`` :ref:`🔗<class_Color_constant_BROWN>`
  223. Brown color.
  224. .. _class_Color_constant_BURLYWOOD:
  225. .. rst-class:: classref-constant
  226. **BURLYWOOD** = ``Color(0.87058824, 0.72156864, 0.5294118, 1)`` :ref:`🔗<class_Color_constant_BURLYWOOD>`
  227. Burlywood color.
  228. .. _class_Color_constant_CADET_BLUE:
  229. .. rst-class:: classref-constant
  230. **CADET_BLUE** = ``Color(0.37254903, 0.61960787, 0.627451, 1)`` :ref:`🔗<class_Color_constant_CADET_BLUE>`
  231. Cadet blue color.
  232. .. _class_Color_constant_CHARTREUSE:
  233. .. rst-class:: classref-constant
  234. **CHARTREUSE** = ``Color(0.49803922, 1, 0, 1)`` :ref:`🔗<class_Color_constant_CHARTREUSE>`
  235. Chartreuse color.
  236. .. _class_Color_constant_CHOCOLATE:
  237. .. rst-class:: classref-constant
  238. **CHOCOLATE** = ``Color(0.8235294, 0.4117647, 0.11764706, 1)`` :ref:`🔗<class_Color_constant_CHOCOLATE>`
  239. Chocolate color.
  240. .. _class_Color_constant_CORAL:
  241. .. rst-class:: classref-constant
  242. **CORAL** = ``Color(1, 0.49803922, 0.3137255, 1)`` :ref:`🔗<class_Color_constant_CORAL>`
  243. Coral color.
  244. .. _class_Color_constant_CORNFLOWER_BLUE:
  245. .. rst-class:: classref-constant
  246. **CORNFLOWER_BLUE** = ``Color(0.39215687, 0.58431375, 0.92941177, 1)`` :ref:`🔗<class_Color_constant_CORNFLOWER_BLUE>`
  247. Cornflower blue color.
  248. .. _class_Color_constant_CORNSILK:
  249. .. rst-class:: classref-constant
  250. **CORNSILK** = ``Color(1, 0.972549, 0.8627451, 1)`` :ref:`🔗<class_Color_constant_CORNSILK>`
  251. Cornsilk color.
  252. .. _class_Color_constant_CRIMSON:
  253. .. rst-class:: classref-constant
  254. **CRIMSON** = ``Color(0.8627451, 0.078431375, 0.23529412, 1)`` :ref:`🔗<class_Color_constant_CRIMSON>`
  255. Crimson color.
  256. .. _class_Color_constant_CYAN:
  257. .. rst-class:: classref-constant
  258. **CYAN** = ``Color(0, 1, 1, 1)`` :ref:`🔗<class_Color_constant_CYAN>`
  259. Cyan color.
  260. .. _class_Color_constant_DARK_BLUE:
  261. .. rst-class:: classref-constant
  262. **DARK_BLUE** = ``Color(0, 0, 0.54509807, 1)`` :ref:`🔗<class_Color_constant_DARK_BLUE>`
  263. Dark blue color.
  264. .. _class_Color_constant_DARK_CYAN:
  265. .. rst-class:: classref-constant
  266. **DARK_CYAN** = ``Color(0, 0.54509807, 0.54509807, 1)`` :ref:`🔗<class_Color_constant_DARK_CYAN>`
  267. Dark cyan color.
  268. .. _class_Color_constant_DARK_GOLDENROD:
  269. .. rst-class:: classref-constant
  270. **DARK_GOLDENROD** = ``Color(0.72156864, 0.5254902, 0.043137256, 1)`` :ref:`🔗<class_Color_constant_DARK_GOLDENROD>`
  271. Dark goldenrod color.
  272. .. _class_Color_constant_DARK_GRAY:
  273. .. rst-class:: classref-constant
  274. **DARK_GRAY** = ``Color(0.6627451, 0.6627451, 0.6627451, 1)`` :ref:`🔗<class_Color_constant_DARK_GRAY>`
  275. Dark gray color.
  276. .. _class_Color_constant_DARK_GREEN:
  277. .. rst-class:: classref-constant
  278. **DARK_GREEN** = ``Color(0, 0.39215687, 0, 1)`` :ref:`🔗<class_Color_constant_DARK_GREEN>`
  279. Dark green color.
  280. .. _class_Color_constant_DARK_KHAKI:
  281. .. rst-class:: classref-constant
  282. **DARK_KHAKI** = ``Color(0.7411765, 0.7176471, 0.41960785, 1)`` :ref:`🔗<class_Color_constant_DARK_KHAKI>`
  283. Dark khaki color.
  284. .. _class_Color_constant_DARK_MAGENTA:
  285. .. rst-class:: classref-constant
  286. **DARK_MAGENTA** = ``Color(0.54509807, 0, 0.54509807, 1)`` :ref:`🔗<class_Color_constant_DARK_MAGENTA>`
  287. Dark magenta color.
  288. .. _class_Color_constant_DARK_OLIVE_GREEN:
  289. .. rst-class:: classref-constant
  290. **DARK_OLIVE_GREEN** = ``Color(0.33333334, 0.41960785, 0.18431373, 1)`` :ref:`🔗<class_Color_constant_DARK_OLIVE_GREEN>`
  291. Dark olive green color.
  292. .. _class_Color_constant_DARK_ORANGE:
  293. .. rst-class:: classref-constant
  294. **DARK_ORANGE** = ``Color(1, 0.54901963, 0, 1)`` :ref:`🔗<class_Color_constant_DARK_ORANGE>`
  295. Dark orange color.
  296. .. _class_Color_constant_DARK_ORCHID:
  297. .. rst-class:: classref-constant
  298. **DARK_ORCHID** = ``Color(0.6, 0.19607843, 0.8, 1)`` :ref:`🔗<class_Color_constant_DARK_ORCHID>`
  299. Dark orchid color.
  300. .. _class_Color_constant_DARK_RED:
  301. .. rst-class:: classref-constant
  302. **DARK_RED** = ``Color(0.54509807, 0, 0, 1)`` :ref:`🔗<class_Color_constant_DARK_RED>`
  303. Dark red color.
  304. .. _class_Color_constant_DARK_SALMON:
  305. .. rst-class:: classref-constant
  306. **DARK_SALMON** = ``Color(0.9137255, 0.5882353, 0.47843137, 1)`` :ref:`🔗<class_Color_constant_DARK_SALMON>`
  307. Dark salmon color.
  308. .. _class_Color_constant_DARK_SEA_GREEN:
  309. .. rst-class:: classref-constant
  310. **DARK_SEA_GREEN** = ``Color(0.56078434, 0.7372549, 0.56078434, 1)`` :ref:`🔗<class_Color_constant_DARK_SEA_GREEN>`
  311. Dark sea green color.
  312. .. _class_Color_constant_DARK_SLATE_BLUE:
  313. .. rst-class:: classref-constant
  314. **DARK_SLATE_BLUE** = ``Color(0.28235295, 0.23921569, 0.54509807, 1)`` :ref:`🔗<class_Color_constant_DARK_SLATE_BLUE>`
  315. Dark slate blue color.
  316. .. _class_Color_constant_DARK_SLATE_GRAY:
  317. .. rst-class:: classref-constant
  318. **DARK_SLATE_GRAY** = ``Color(0.18431373, 0.30980393, 0.30980393, 1)`` :ref:`🔗<class_Color_constant_DARK_SLATE_GRAY>`
  319. Dark slate gray color.
  320. .. _class_Color_constant_DARK_TURQUOISE:
  321. .. rst-class:: classref-constant
  322. **DARK_TURQUOISE** = ``Color(0, 0.80784315, 0.81960785, 1)`` :ref:`🔗<class_Color_constant_DARK_TURQUOISE>`
  323. Dark turquoise color.
  324. .. _class_Color_constant_DARK_VIOLET:
  325. .. rst-class:: classref-constant
  326. **DARK_VIOLET** = ``Color(0.5803922, 0, 0.827451, 1)`` :ref:`🔗<class_Color_constant_DARK_VIOLET>`
  327. Dark violet color.
  328. .. _class_Color_constant_DEEP_PINK:
  329. .. rst-class:: classref-constant
  330. **DEEP_PINK** = ``Color(1, 0.078431375, 0.5764706, 1)`` :ref:`🔗<class_Color_constant_DEEP_PINK>`
  331. Deep pink color.
  332. .. _class_Color_constant_DEEP_SKY_BLUE:
  333. .. rst-class:: classref-constant
  334. **DEEP_SKY_BLUE** = ``Color(0, 0.7490196, 1, 1)`` :ref:`🔗<class_Color_constant_DEEP_SKY_BLUE>`
  335. Deep sky blue color.
  336. .. _class_Color_constant_DIM_GRAY:
  337. .. rst-class:: classref-constant
  338. **DIM_GRAY** = ``Color(0.4117647, 0.4117647, 0.4117647, 1)`` :ref:`🔗<class_Color_constant_DIM_GRAY>`
  339. Dim gray color.
  340. .. _class_Color_constant_DODGER_BLUE:
  341. .. rst-class:: classref-constant
  342. **DODGER_BLUE** = ``Color(0.11764706, 0.5647059, 1, 1)`` :ref:`🔗<class_Color_constant_DODGER_BLUE>`
  343. Dodger blue color.
  344. .. _class_Color_constant_FIREBRICK:
  345. .. rst-class:: classref-constant
  346. **FIREBRICK** = ``Color(0.69803923, 0.13333334, 0.13333334, 1)`` :ref:`🔗<class_Color_constant_FIREBRICK>`
  347. Firebrick color.
  348. .. _class_Color_constant_FLORAL_WHITE:
  349. .. rst-class:: classref-constant
  350. **FLORAL_WHITE** = ``Color(1, 0.98039216, 0.9411765, 1)`` :ref:`🔗<class_Color_constant_FLORAL_WHITE>`
  351. Floral white color.
  352. .. _class_Color_constant_FOREST_GREEN:
  353. .. rst-class:: classref-constant
  354. **FOREST_GREEN** = ``Color(0.13333334, 0.54509807, 0.13333334, 1)`` :ref:`🔗<class_Color_constant_FOREST_GREEN>`
  355. Forest green color.
  356. .. _class_Color_constant_FUCHSIA:
  357. .. rst-class:: classref-constant
  358. **FUCHSIA** = ``Color(1, 0, 1, 1)`` :ref:`🔗<class_Color_constant_FUCHSIA>`
  359. Fuchsia color.
  360. .. _class_Color_constant_GAINSBORO:
  361. .. rst-class:: classref-constant
  362. **GAINSBORO** = ``Color(0.8627451, 0.8627451, 0.8627451, 1)`` :ref:`🔗<class_Color_constant_GAINSBORO>`
  363. Gainsboro color.
  364. .. _class_Color_constant_GHOST_WHITE:
  365. .. rst-class:: classref-constant
  366. **GHOST_WHITE** = ``Color(0.972549, 0.972549, 1, 1)`` :ref:`🔗<class_Color_constant_GHOST_WHITE>`
  367. Ghost white color.
  368. .. _class_Color_constant_GOLD:
  369. .. rst-class:: classref-constant
  370. **GOLD** = ``Color(1, 0.84313726, 0, 1)`` :ref:`🔗<class_Color_constant_GOLD>`
  371. Gold color.
  372. .. _class_Color_constant_GOLDENROD:
  373. .. rst-class:: classref-constant
  374. **GOLDENROD** = ``Color(0.85490197, 0.64705884, 0.1254902, 1)`` :ref:`🔗<class_Color_constant_GOLDENROD>`
  375. Goldenrod color.
  376. .. _class_Color_constant_GRAY:
  377. .. rst-class:: classref-constant
  378. **GRAY** = ``Color(0.74509805, 0.74509805, 0.74509805, 1)`` :ref:`🔗<class_Color_constant_GRAY>`
  379. Gray color.
  380. .. _class_Color_constant_GREEN:
  381. .. rst-class:: classref-constant
  382. **GREEN** = ``Color(0, 1, 0, 1)`` :ref:`🔗<class_Color_constant_GREEN>`
  383. Green color.
  384. .. _class_Color_constant_GREEN_YELLOW:
  385. .. rst-class:: classref-constant
  386. **GREEN_YELLOW** = ``Color(0.6784314, 1, 0.18431373, 1)`` :ref:`🔗<class_Color_constant_GREEN_YELLOW>`
  387. Green yellow color.
  388. .. _class_Color_constant_HONEYDEW:
  389. .. rst-class:: classref-constant
  390. **HONEYDEW** = ``Color(0.9411765, 1, 0.9411765, 1)`` :ref:`🔗<class_Color_constant_HONEYDEW>`
  391. Honeydew color.
  392. .. _class_Color_constant_HOT_PINK:
  393. .. rst-class:: classref-constant
  394. **HOT_PINK** = ``Color(1, 0.4117647, 0.7058824, 1)`` :ref:`🔗<class_Color_constant_HOT_PINK>`
  395. Hot pink color.
  396. .. _class_Color_constant_INDIAN_RED:
  397. .. rst-class:: classref-constant
  398. **INDIAN_RED** = ``Color(0.8039216, 0.36078432, 0.36078432, 1)`` :ref:`🔗<class_Color_constant_INDIAN_RED>`
  399. Indian red color.
  400. .. _class_Color_constant_INDIGO:
  401. .. rst-class:: classref-constant
  402. **INDIGO** = ``Color(0.29411766, 0, 0.50980395, 1)`` :ref:`🔗<class_Color_constant_INDIGO>`
  403. Indigo color.
  404. .. _class_Color_constant_IVORY:
  405. .. rst-class:: classref-constant
  406. **IVORY** = ``Color(1, 1, 0.9411765, 1)`` :ref:`🔗<class_Color_constant_IVORY>`
  407. Ivory color.
  408. .. _class_Color_constant_KHAKI:
  409. .. rst-class:: classref-constant
  410. **KHAKI** = ``Color(0.9411765, 0.9019608, 0.54901963, 1)`` :ref:`🔗<class_Color_constant_KHAKI>`
  411. Khaki color.
  412. .. _class_Color_constant_LAVENDER:
  413. .. rst-class:: classref-constant
  414. **LAVENDER** = ``Color(0.9019608, 0.9019608, 0.98039216, 1)`` :ref:`🔗<class_Color_constant_LAVENDER>`
  415. Lavender color.
  416. .. _class_Color_constant_LAVENDER_BLUSH:
  417. .. rst-class:: classref-constant
  418. **LAVENDER_BLUSH** = ``Color(1, 0.9411765, 0.9607843, 1)`` :ref:`🔗<class_Color_constant_LAVENDER_BLUSH>`
  419. Lavender blush color.
  420. .. _class_Color_constant_LAWN_GREEN:
  421. .. rst-class:: classref-constant
  422. **LAWN_GREEN** = ``Color(0.4862745, 0.9882353, 0, 1)`` :ref:`🔗<class_Color_constant_LAWN_GREEN>`
  423. Lawn green color.
  424. .. _class_Color_constant_LEMON_CHIFFON:
  425. .. rst-class:: classref-constant
  426. **LEMON_CHIFFON** = ``Color(1, 0.98039216, 0.8039216, 1)`` :ref:`🔗<class_Color_constant_LEMON_CHIFFON>`
  427. Lemon chiffon color.
  428. .. _class_Color_constant_LIGHT_BLUE:
  429. .. rst-class:: classref-constant
  430. **LIGHT_BLUE** = ``Color(0.6784314, 0.84705883, 0.9019608, 1)`` :ref:`🔗<class_Color_constant_LIGHT_BLUE>`
  431. Light blue color.
  432. .. _class_Color_constant_LIGHT_CORAL:
  433. .. rst-class:: classref-constant
  434. **LIGHT_CORAL** = ``Color(0.9411765, 0.5019608, 0.5019608, 1)`` :ref:`🔗<class_Color_constant_LIGHT_CORAL>`
  435. Light coral color.
  436. .. _class_Color_constant_LIGHT_CYAN:
  437. .. rst-class:: classref-constant
  438. **LIGHT_CYAN** = ``Color(0.8784314, 1, 1, 1)`` :ref:`🔗<class_Color_constant_LIGHT_CYAN>`
  439. Light cyan color.
  440. .. _class_Color_constant_LIGHT_GOLDENROD:
  441. .. rst-class:: classref-constant
  442. **LIGHT_GOLDENROD** = ``Color(0.98039216, 0.98039216, 0.8235294, 1)`` :ref:`🔗<class_Color_constant_LIGHT_GOLDENROD>`
  443. Light goldenrod color.
  444. .. _class_Color_constant_LIGHT_GRAY:
  445. .. rst-class:: classref-constant
  446. **LIGHT_GRAY** = ``Color(0.827451, 0.827451, 0.827451, 1)`` :ref:`🔗<class_Color_constant_LIGHT_GRAY>`
  447. Light gray color.
  448. .. _class_Color_constant_LIGHT_GREEN:
  449. .. rst-class:: classref-constant
  450. **LIGHT_GREEN** = ``Color(0.5647059, 0.93333334, 0.5647059, 1)`` :ref:`🔗<class_Color_constant_LIGHT_GREEN>`
  451. Light green color.
  452. .. _class_Color_constant_LIGHT_PINK:
  453. .. rst-class:: classref-constant
  454. **LIGHT_PINK** = ``Color(1, 0.7137255, 0.75686276, 1)`` :ref:`🔗<class_Color_constant_LIGHT_PINK>`
  455. Light pink color.
  456. .. _class_Color_constant_LIGHT_SALMON:
  457. .. rst-class:: classref-constant
  458. **LIGHT_SALMON** = ``Color(1, 0.627451, 0.47843137, 1)`` :ref:`🔗<class_Color_constant_LIGHT_SALMON>`
  459. Light salmon color.
  460. .. _class_Color_constant_LIGHT_SEA_GREEN:
  461. .. rst-class:: classref-constant
  462. **LIGHT_SEA_GREEN** = ``Color(0.1254902, 0.69803923, 0.6666667, 1)`` :ref:`🔗<class_Color_constant_LIGHT_SEA_GREEN>`
  463. Light sea green color.
  464. .. _class_Color_constant_LIGHT_SKY_BLUE:
  465. .. rst-class:: classref-constant
  466. **LIGHT_SKY_BLUE** = ``Color(0.5294118, 0.80784315, 0.98039216, 1)`` :ref:`🔗<class_Color_constant_LIGHT_SKY_BLUE>`
  467. Light sky blue color.
  468. .. _class_Color_constant_LIGHT_SLATE_GRAY:
  469. .. rst-class:: classref-constant
  470. **LIGHT_SLATE_GRAY** = ``Color(0.46666667, 0.53333336, 0.6, 1)`` :ref:`🔗<class_Color_constant_LIGHT_SLATE_GRAY>`
  471. Light slate gray color.
  472. .. _class_Color_constant_LIGHT_STEEL_BLUE:
  473. .. rst-class:: classref-constant
  474. **LIGHT_STEEL_BLUE** = ``Color(0.6901961, 0.76862746, 0.87058824, 1)`` :ref:`🔗<class_Color_constant_LIGHT_STEEL_BLUE>`
  475. Light steel blue color.
  476. .. _class_Color_constant_LIGHT_YELLOW:
  477. .. rst-class:: classref-constant
  478. **LIGHT_YELLOW** = ``Color(1, 1, 0.8784314, 1)`` :ref:`🔗<class_Color_constant_LIGHT_YELLOW>`
  479. Light yellow color.
  480. .. _class_Color_constant_LIME:
  481. .. rst-class:: classref-constant
  482. **LIME** = ``Color(0, 1, 0, 1)`` :ref:`🔗<class_Color_constant_LIME>`
  483. Lime color.
  484. .. _class_Color_constant_LIME_GREEN:
  485. .. rst-class:: classref-constant
  486. **LIME_GREEN** = ``Color(0.19607843, 0.8039216, 0.19607843, 1)`` :ref:`🔗<class_Color_constant_LIME_GREEN>`
  487. Lime green color.
  488. .. _class_Color_constant_LINEN:
  489. .. rst-class:: classref-constant
  490. **LINEN** = ``Color(0.98039216, 0.9411765, 0.9019608, 1)`` :ref:`🔗<class_Color_constant_LINEN>`
  491. Linen color.
  492. .. _class_Color_constant_MAGENTA:
  493. .. rst-class:: classref-constant
  494. **MAGENTA** = ``Color(1, 0, 1, 1)`` :ref:`🔗<class_Color_constant_MAGENTA>`
  495. Magenta color.
  496. .. _class_Color_constant_MAROON:
  497. .. rst-class:: classref-constant
  498. **MAROON** = ``Color(0.6901961, 0.1882353, 0.3764706, 1)`` :ref:`🔗<class_Color_constant_MAROON>`
  499. Maroon color.
  500. .. _class_Color_constant_MEDIUM_AQUAMARINE:
  501. .. rst-class:: classref-constant
  502. **MEDIUM_AQUAMARINE** = ``Color(0.4, 0.8039216, 0.6666667, 1)`` :ref:`🔗<class_Color_constant_MEDIUM_AQUAMARINE>`
  503. Medium aquamarine color.
  504. .. _class_Color_constant_MEDIUM_BLUE:
  505. .. rst-class:: classref-constant
  506. **MEDIUM_BLUE** = ``Color(0, 0, 0.8039216, 1)`` :ref:`🔗<class_Color_constant_MEDIUM_BLUE>`
  507. Medium blue color.
  508. .. _class_Color_constant_MEDIUM_ORCHID:
  509. .. rst-class:: classref-constant
  510. **MEDIUM_ORCHID** = ``Color(0.7294118, 0.33333334, 0.827451, 1)`` :ref:`🔗<class_Color_constant_MEDIUM_ORCHID>`
  511. Medium orchid color.
  512. .. _class_Color_constant_MEDIUM_PURPLE:
  513. .. rst-class:: classref-constant
  514. **MEDIUM_PURPLE** = ``Color(0.5764706, 0.4392157, 0.85882354, 1)`` :ref:`🔗<class_Color_constant_MEDIUM_PURPLE>`
  515. Medium purple color.
  516. .. _class_Color_constant_MEDIUM_SEA_GREEN:
  517. .. rst-class:: classref-constant
  518. **MEDIUM_SEA_GREEN** = ``Color(0.23529412, 0.7019608, 0.44313726, 1)`` :ref:`🔗<class_Color_constant_MEDIUM_SEA_GREEN>`
  519. Medium sea green color.
  520. .. _class_Color_constant_MEDIUM_SLATE_BLUE:
  521. .. rst-class:: classref-constant
  522. **MEDIUM_SLATE_BLUE** = ``Color(0.48235294, 0.40784314, 0.93333334, 1)`` :ref:`🔗<class_Color_constant_MEDIUM_SLATE_BLUE>`
  523. Medium slate blue color.
  524. .. _class_Color_constant_MEDIUM_SPRING_GREEN:
  525. .. rst-class:: classref-constant
  526. **MEDIUM_SPRING_GREEN** = ``Color(0, 0.98039216, 0.6039216, 1)`` :ref:`🔗<class_Color_constant_MEDIUM_SPRING_GREEN>`
  527. Medium spring green color.
  528. .. _class_Color_constant_MEDIUM_TURQUOISE:
  529. .. rst-class:: classref-constant
  530. **MEDIUM_TURQUOISE** = ``Color(0.28235295, 0.81960785, 0.8, 1)`` :ref:`🔗<class_Color_constant_MEDIUM_TURQUOISE>`
  531. Medium turquoise color.
  532. .. _class_Color_constant_MEDIUM_VIOLET_RED:
  533. .. rst-class:: classref-constant
  534. **MEDIUM_VIOLET_RED** = ``Color(0.78039217, 0.08235294, 0.52156866, 1)`` :ref:`🔗<class_Color_constant_MEDIUM_VIOLET_RED>`
  535. Medium violet red color.
  536. .. _class_Color_constant_MIDNIGHT_BLUE:
  537. .. rst-class:: classref-constant
  538. **MIDNIGHT_BLUE** = ``Color(0.09803922, 0.09803922, 0.4392157, 1)`` :ref:`🔗<class_Color_constant_MIDNIGHT_BLUE>`
  539. Midnight blue color.
  540. .. _class_Color_constant_MINT_CREAM:
  541. .. rst-class:: classref-constant
  542. **MINT_CREAM** = ``Color(0.9607843, 1, 0.98039216, 1)`` :ref:`🔗<class_Color_constant_MINT_CREAM>`
  543. Mint cream color.
  544. .. _class_Color_constant_MISTY_ROSE:
  545. .. rst-class:: classref-constant
  546. **MISTY_ROSE** = ``Color(1, 0.89411765, 0.88235295, 1)`` :ref:`🔗<class_Color_constant_MISTY_ROSE>`
  547. Misty rose color.
  548. .. _class_Color_constant_MOCCASIN:
  549. .. rst-class:: classref-constant
  550. **MOCCASIN** = ``Color(1, 0.89411765, 0.70980394, 1)`` :ref:`🔗<class_Color_constant_MOCCASIN>`
  551. Moccasin color.
  552. .. _class_Color_constant_NAVAJO_WHITE:
  553. .. rst-class:: classref-constant
  554. **NAVAJO_WHITE** = ``Color(1, 0.87058824, 0.6784314, 1)`` :ref:`🔗<class_Color_constant_NAVAJO_WHITE>`
  555. Navajo white color.
  556. .. _class_Color_constant_NAVY_BLUE:
  557. .. rst-class:: classref-constant
  558. **NAVY_BLUE** = ``Color(0, 0, 0.5019608, 1)`` :ref:`🔗<class_Color_constant_NAVY_BLUE>`
  559. Navy blue color.
  560. .. _class_Color_constant_OLD_LACE:
  561. .. rst-class:: classref-constant
  562. **OLD_LACE** = ``Color(0.99215686, 0.9607843, 0.9019608, 1)`` :ref:`🔗<class_Color_constant_OLD_LACE>`
  563. Old lace color.
  564. .. _class_Color_constant_OLIVE:
  565. .. rst-class:: classref-constant
  566. **OLIVE** = ``Color(0.5019608, 0.5019608, 0, 1)`` :ref:`🔗<class_Color_constant_OLIVE>`
  567. Olive color.
  568. .. _class_Color_constant_OLIVE_DRAB:
  569. .. rst-class:: classref-constant
  570. **OLIVE_DRAB** = ``Color(0.41960785, 0.5568628, 0.13725491, 1)`` :ref:`🔗<class_Color_constant_OLIVE_DRAB>`
  571. Olive drab color.
  572. .. _class_Color_constant_ORANGE:
  573. .. rst-class:: classref-constant
  574. **ORANGE** = ``Color(1, 0.64705884, 0, 1)`` :ref:`🔗<class_Color_constant_ORANGE>`
  575. Orange color.
  576. .. _class_Color_constant_ORANGE_RED:
  577. .. rst-class:: classref-constant
  578. **ORANGE_RED** = ``Color(1, 0.27058825, 0, 1)`` :ref:`🔗<class_Color_constant_ORANGE_RED>`
  579. Orange red color.
  580. .. _class_Color_constant_ORCHID:
  581. .. rst-class:: classref-constant
  582. **ORCHID** = ``Color(0.85490197, 0.4392157, 0.8392157, 1)`` :ref:`🔗<class_Color_constant_ORCHID>`
  583. Orchid color.
  584. .. _class_Color_constant_PALE_GOLDENROD:
  585. .. rst-class:: classref-constant
  586. **PALE_GOLDENROD** = ``Color(0.93333334, 0.9098039, 0.6666667, 1)`` :ref:`🔗<class_Color_constant_PALE_GOLDENROD>`
  587. Pale goldenrod color.
  588. .. _class_Color_constant_PALE_GREEN:
  589. .. rst-class:: classref-constant
  590. **PALE_GREEN** = ``Color(0.59607846, 0.9843137, 0.59607846, 1)`` :ref:`🔗<class_Color_constant_PALE_GREEN>`
  591. Pale green color.
  592. .. _class_Color_constant_PALE_TURQUOISE:
  593. .. rst-class:: classref-constant
  594. **PALE_TURQUOISE** = ``Color(0.6862745, 0.93333334, 0.93333334, 1)`` :ref:`🔗<class_Color_constant_PALE_TURQUOISE>`
  595. Pale turquoise color.
  596. .. _class_Color_constant_PALE_VIOLET_RED:
  597. .. rst-class:: classref-constant
  598. **PALE_VIOLET_RED** = ``Color(0.85882354, 0.4392157, 0.5764706, 1)`` :ref:`🔗<class_Color_constant_PALE_VIOLET_RED>`
  599. Pale violet red color.
  600. .. _class_Color_constant_PAPAYA_WHIP:
  601. .. rst-class:: classref-constant
  602. **PAPAYA_WHIP** = ``Color(1, 0.9372549, 0.8352941, 1)`` :ref:`🔗<class_Color_constant_PAPAYA_WHIP>`
  603. Papaya whip color.
  604. .. _class_Color_constant_PEACH_PUFF:
  605. .. rst-class:: classref-constant
  606. **PEACH_PUFF** = ``Color(1, 0.85490197, 0.7254902, 1)`` :ref:`🔗<class_Color_constant_PEACH_PUFF>`
  607. Peach puff color.
  608. .. _class_Color_constant_PERU:
  609. .. rst-class:: classref-constant
  610. **PERU** = ``Color(0.8039216, 0.52156866, 0.24705882, 1)`` :ref:`🔗<class_Color_constant_PERU>`
  611. Peru color.
  612. .. _class_Color_constant_PINK:
  613. .. rst-class:: classref-constant
  614. **PINK** = ``Color(1, 0.7529412, 0.79607844, 1)`` :ref:`🔗<class_Color_constant_PINK>`
  615. Pink color.
  616. .. _class_Color_constant_PLUM:
  617. .. rst-class:: classref-constant
  618. **PLUM** = ``Color(0.8666667, 0.627451, 0.8666667, 1)`` :ref:`🔗<class_Color_constant_PLUM>`
  619. Plum color.
  620. .. _class_Color_constant_POWDER_BLUE:
  621. .. rst-class:: classref-constant
  622. **POWDER_BLUE** = ``Color(0.6901961, 0.8784314, 0.9019608, 1)`` :ref:`🔗<class_Color_constant_POWDER_BLUE>`
  623. Powder blue color.
  624. .. _class_Color_constant_PURPLE:
  625. .. rst-class:: classref-constant
  626. **PURPLE** = ``Color(0.627451, 0.1254902, 0.9411765, 1)`` :ref:`🔗<class_Color_constant_PURPLE>`
  627. Purple color.
  628. .. _class_Color_constant_REBECCA_PURPLE:
  629. .. rst-class:: classref-constant
  630. **REBECCA_PURPLE** = ``Color(0.4, 0.2, 0.6, 1)`` :ref:`🔗<class_Color_constant_REBECCA_PURPLE>`
  631. Rebecca purple color.
  632. .. _class_Color_constant_RED:
  633. .. rst-class:: classref-constant
  634. **RED** = ``Color(1, 0, 0, 1)`` :ref:`🔗<class_Color_constant_RED>`
  635. Red color.
  636. .. _class_Color_constant_ROSY_BROWN:
  637. .. rst-class:: classref-constant
  638. **ROSY_BROWN** = ``Color(0.7372549, 0.56078434, 0.56078434, 1)`` :ref:`🔗<class_Color_constant_ROSY_BROWN>`
  639. Rosy brown color.
  640. .. _class_Color_constant_ROYAL_BLUE:
  641. .. rst-class:: classref-constant
  642. **ROYAL_BLUE** = ``Color(0.25490198, 0.4117647, 0.88235295, 1)`` :ref:`🔗<class_Color_constant_ROYAL_BLUE>`
  643. Royal blue color.
  644. .. _class_Color_constant_SADDLE_BROWN:
  645. .. rst-class:: classref-constant
  646. **SADDLE_BROWN** = ``Color(0.54509807, 0.27058825, 0.07450981, 1)`` :ref:`🔗<class_Color_constant_SADDLE_BROWN>`
  647. Saddle brown color.
  648. .. _class_Color_constant_SALMON:
  649. .. rst-class:: classref-constant
  650. **SALMON** = ``Color(0.98039216, 0.5019608, 0.44705883, 1)`` :ref:`🔗<class_Color_constant_SALMON>`
  651. Salmon color.
  652. .. _class_Color_constant_SANDY_BROWN:
  653. .. rst-class:: classref-constant
  654. **SANDY_BROWN** = ``Color(0.95686275, 0.6431373, 0.3764706, 1)`` :ref:`🔗<class_Color_constant_SANDY_BROWN>`
  655. Sandy brown color.
  656. .. _class_Color_constant_SEA_GREEN:
  657. .. rst-class:: classref-constant
  658. **SEA_GREEN** = ``Color(0.18039216, 0.54509807, 0.34117648, 1)`` :ref:`🔗<class_Color_constant_SEA_GREEN>`
  659. Sea green color.
  660. .. _class_Color_constant_SEASHELL:
  661. .. rst-class:: classref-constant
  662. **SEASHELL** = ``Color(1, 0.9607843, 0.93333334, 1)`` :ref:`🔗<class_Color_constant_SEASHELL>`
  663. Seashell color.
  664. .. _class_Color_constant_SIENNA:
  665. .. rst-class:: classref-constant
  666. **SIENNA** = ``Color(0.627451, 0.32156864, 0.1764706, 1)`` :ref:`🔗<class_Color_constant_SIENNA>`
  667. Sienna color.
  668. .. _class_Color_constant_SILVER:
  669. .. rst-class:: classref-constant
  670. **SILVER** = ``Color(0.7529412, 0.7529412, 0.7529412, 1)`` :ref:`🔗<class_Color_constant_SILVER>`
  671. Silver color.
  672. .. _class_Color_constant_SKY_BLUE:
  673. .. rst-class:: classref-constant
  674. **SKY_BLUE** = ``Color(0.5294118, 0.80784315, 0.92156863, 1)`` :ref:`🔗<class_Color_constant_SKY_BLUE>`
  675. Sky blue color.
  676. .. _class_Color_constant_SLATE_BLUE:
  677. .. rst-class:: classref-constant
  678. **SLATE_BLUE** = ``Color(0.41568628, 0.3529412, 0.8039216, 1)`` :ref:`🔗<class_Color_constant_SLATE_BLUE>`
  679. Slate blue color.
  680. .. _class_Color_constant_SLATE_GRAY:
  681. .. rst-class:: classref-constant
  682. **SLATE_GRAY** = ``Color(0.4392157, 0.5019608, 0.5647059, 1)`` :ref:`🔗<class_Color_constant_SLATE_GRAY>`
  683. Slate gray color.
  684. .. _class_Color_constant_SNOW:
  685. .. rst-class:: classref-constant
  686. **SNOW** = ``Color(1, 0.98039216, 0.98039216, 1)`` :ref:`🔗<class_Color_constant_SNOW>`
  687. Snow color.
  688. .. _class_Color_constant_SPRING_GREEN:
  689. .. rst-class:: classref-constant
  690. **SPRING_GREEN** = ``Color(0, 1, 0.49803922, 1)`` :ref:`🔗<class_Color_constant_SPRING_GREEN>`
  691. Spring green color.
  692. .. _class_Color_constant_STEEL_BLUE:
  693. .. rst-class:: classref-constant
  694. **STEEL_BLUE** = ``Color(0.27450982, 0.50980395, 0.7058824, 1)`` :ref:`🔗<class_Color_constant_STEEL_BLUE>`
  695. Steel blue color.
  696. .. _class_Color_constant_TAN:
  697. .. rst-class:: classref-constant
  698. **TAN** = ``Color(0.8235294, 0.7058824, 0.54901963, 1)`` :ref:`🔗<class_Color_constant_TAN>`
  699. Tan color.
  700. .. _class_Color_constant_TEAL:
  701. .. rst-class:: classref-constant
  702. **TEAL** = ``Color(0, 0.5019608, 0.5019608, 1)`` :ref:`🔗<class_Color_constant_TEAL>`
  703. Teal color.
  704. .. _class_Color_constant_THISTLE:
  705. .. rst-class:: classref-constant
  706. **THISTLE** = ``Color(0.84705883, 0.7490196, 0.84705883, 1)`` :ref:`🔗<class_Color_constant_THISTLE>`
  707. Thistle color.
  708. .. _class_Color_constant_TOMATO:
  709. .. rst-class:: classref-constant
  710. **TOMATO** = ``Color(1, 0.3882353, 0.2784314, 1)`` :ref:`🔗<class_Color_constant_TOMATO>`
  711. Tomato color.
  712. .. _class_Color_constant_TRANSPARENT:
  713. .. rst-class:: classref-constant
  714. **TRANSPARENT** = ``Color(1, 1, 1, 0)`` :ref:`🔗<class_Color_constant_TRANSPARENT>`
  715. Transparent color (white with zero alpha).
  716. .. _class_Color_constant_TURQUOISE:
  717. .. rst-class:: classref-constant
  718. **TURQUOISE** = ``Color(0.2509804, 0.8784314, 0.8156863, 1)`` :ref:`🔗<class_Color_constant_TURQUOISE>`
  719. Turquoise color.
  720. .. _class_Color_constant_VIOLET:
  721. .. rst-class:: classref-constant
  722. **VIOLET** = ``Color(0.93333334, 0.50980395, 0.93333334, 1)`` :ref:`🔗<class_Color_constant_VIOLET>`
  723. Violet color.
  724. .. _class_Color_constant_WEB_GRAY:
  725. .. rst-class:: classref-constant
  726. **WEB_GRAY** = ``Color(0.5019608, 0.5019608, 0.5019608, 1)`` :ref:`🔗<class_Color_constant_WEB_GRAY>`
  727. Web gray color.
  728. .. _class_Color_constant_WEB_GREEN:
  729. .. rst-class:: classref-constant
  730. **WEB_GREEN** = ``Color(0, 0.5019608, 0, 1)`` :ref:`🔗<class_Color_constant_WEB_GREEN>`
  731. Web green color.
  732. .. _class_Color_constant_WEB_MAROON:
  733. .. rst-class:: classref-constant
  734. **WEB_MAROON** = ``Color(0.5019608, 0, 0, 1)`` :ref:`🔗<class_Color_constant_WEB_MAROON>`
  735. Web maroon color.
  736. .. _class_Color_constant_WEB_PURPLE:
  737. .. rst-class:: classref-constant
  738. **WEB_PURPLE** = ``Color(0.5019608, 0, 0.5019608, 1)`` :ref:`🔗<class_Color_constant_WEB_PURPLE>`
  739. Web purple color.
  740. .. _class_Color_constant_WHEAT:
  741. .. rst-class:: classref-constant
  742. **WHEAT** = ``Color(0.9607843, 0.87058824, 0.7019608, 1)`` :ref:`🔗<class_Color_constant_WHEAT>`
  743. Wheat color.
  744. .. _class_Color_constant_WHITE:
  745. .. rst-class:: classref-constant
  746. **WHITE** = ``Color(1, 1, 1, 1)`` :ref:`🔗<class_Color_constant_WHITE>`
  747. White color.
  748. .. _class_Color_constant_WHITE_SMOKE:
  749. .. rst-class:: classref-constant
  750. **WHITE_SMOKE** = ``Color(0.9607843, 0.9607843, 0.9607843, 1)`` :ref:`🔗<class_Color_constant_WHITE_SMOKE>`
  751. White smoke color.
  752. .. _class_Color_constant_YELLOW:
  753. .. rst-class:: classref-constant
  754. **YELLOW** = ``Color(1, 1, 0, 1)`` :ref:`🔗<class_Color_constant_YELLOW>`
  755. Yellow color.
  756. .. _class_Color_constant_YELLOW_GREEN:
  757. .. rst-class:: classref-constant
  758. **YELLOW_GREEN** = ``Color(0.6039216, 0.8039216, 0.19607843, 1)`` :ref:`🔗<class_Color_constant_YELLOW_GREEN>`
  759. Yellow green color.
  760. .. rst-class:: classref-section-separator
  761. ----
  762. .. rst-class:: classref-descriptions-group
  763. Property Descriptions
  764. ---------------------
  765. .. _class_Color_property_a:
  766. .. rst-class:: classref-property
  767. :ref:`float<class_float>` **a** = ``1.0`` :ref:`🔗<class_Color_property_a>`
  768. The color's alpha component, typically on the range of 0 to 1. A value of 0 means that the color is fully transparent. A value of 1 means that the color is fully opaque.
  769. \ **Note:** The alpha channel is always stored with linear encoding, regardless of the encoding of the other color channels. The :ref:`linear_to_srgb()<class_Color_method_linear_to_srgb>` and :ref:`srgb_to_linear()<class_Color_method_srgb_to_linear>` methods do not affect the alpha channel.
  770. .. rst-class:: classref-item-separator
  771. ----
  772. .. _class_Color_property_a8:
  773. .. rst-class:: classref-property
  774. :ref:`int<class_int>` **a8** = ``255`` :ref:`🔗<class_Color_property_a8>`
  775. Wrapper for :ref:`a<class_Color_property_a>` that uses the range 0 to 255, instead of 0 to 1.
  776. .. rst-class:: classref-item-separator
  777. ----
  778. .. _class_Color_property_b:
  779. .. rst-class:: classref-property
  780. :ref:`float<class_float>` **b** = ``0.0`` :ref:`🔗<class_Color_property_b>`
  781. The color's blue component, typically on the range of 0 to 1.
  782. .. rst-class:: classref-item-separator
  783. ----
  784. .. _class_Color_property_b8:
  785. .. rst-class:: classref-property
  786. :ref:`int<class_int>` **b8** = ``0`` :ref:`🔗<class_Color_property_b8>`
  787. Wrapper for :ref:`b<class_Color_property_b>` that uses the range 0 to 255, instead of 0 to 1.
  788. .. rst-class:: classref-item-separator
  789. ----
  790. .. _class_Color_property_g:
  791. .. rst-class:: classref-property
  792. :ref:`float<class_float>` **g** = ``0.0`` :ref:`🔗<class_Color_property_g>`
  793. The color's green component, typically on the range of 0 to 1.
  794. .. rst-class:: classref-item-separator
  795. ----
  796. .. _class_Color_property_g8:
  797. .. rst-class:: classref-property
  798. :ref:`int<class_int>` **g8** = ``0`` :ref:`🔗<class_Color_property_g8>`
  799. Wrapper for :ref:`g<class_Color_property_g>` that uses the range 0 to 255, instead of 0 to 1.
  800. .. rst-class:: classref-item-separator
  801. ----
  802. .. _class_Color_property_h:
  803. .. rst-class:: classref-property
  804. :ref:`float<class_float>` **h** = ``0.0`` :ref:`🔗<class_Color_property_h>`
  805. The HSV hue of this color, on the range 0 to 1.
  806. .. rst-class:: classref-item-separator
  807. ----
  808. .. _class_Color_property_ok_hsl_h:
  809. .. rst-class:: classref-property
  810. :ref:`float<class_float>` **ok_hsl_h** = ``0.0`` :ref:`🔗<class_Color_property_ok_hsl_h>`
  811. The OKHSL hue of this color, on the range 0 to 1.
  812. .. rst-class:: classref-item-separator
  813. ----
  814. .. _class_Color_property_ok_hsl_l:
  815. .. rst-class:: classref-property
  816. :ref:`float<class_float>` **ok_hsl_l** = ``0.0`` :ref:`🔗<class_Color_property_ok_hsl_l>`
  817. The OKHSL lightness of this color, on the range 0 to 1.
  818. .. rst-class:: classref-item-separator
  819. ----
  820. .. _class_Color_property_ok_hsl_s:
  821. .. rst-class:: classref-property
  822. :ref:`float<class_float>` **ok_hsl_s** = ``0.0`` :ref:`🔗<class_Color_property_ok_hsl_s>`
  823. The OKHSL saturation of this color, on the range 0 to 1.
  824. .. rst-class:: classref-item-separator
  825. ----
  826. .. _class_Color_property_r:
  827. .. rst-class:: classref-property
  828. :ref:`float<class_float>` **r** = ``0.0`` :ref:`🔗<class_Color_property_r>`
  829. The color's red component, typically on the range of 0 to 1.
  830. .. rst-class:: classref-item-separator
  831. ----
  832. .. _class_Color_property_r8:
  833. .. rst-class:: classref-property
  834. :ref:`int<class_int>` **r8** = ``0`` :ref:`🔗<class_Color_property_r8>`
  835. Wrapper for :ref:`r<class_Color_property_r>` that uses the range 0 to 255, instead of 0 to 1.
  836. .. rst-class:: classref-item-separator
  837. ----
  838. .. _class_Color_property_s:
  839. .. rst-class:: classref-property
  840. :ref:`float<class_float>` **s** = ``0.0`` :ref:`🔗<class_Color_property_s>`
  841. The HSV saturation of this color, on the range 0 to 1.
  842. .. rst-class:: classref-item-separator
  843. ----
  844. .. _class_Color_property_v:
  845. .. rst-class:: classref-property
  846. :ref:`float<class_float>` **v** = ``0.0`` :ref:`🔗<class_Color_property_v>`
  847. The HSV value (brightness) of this color, on the range 0 to 1.
  848. .. rst-class:: classref-section-separator
  849. ----
  850. .. rst-class:: classref-descriptions-group
  851. Constructor Descriptions
  852. ------------------------
  853. .. _class_Color_constructor_Color:
  854. .. rst-class:: classref-constructor
  855. :ref:`Color<class_Color>` **Color**\ (\ ) :ref:`🔗<class_Color_constructor_Color>`
  856. Constructs a default **Color** from opaque black. This is the same as :ref:`BLACK<class_Color_constant_BLACK>`.
  857. \ **Note:** In C#, this constructs a **Color** with all of its components set to ``0.0`` (transparent black).
  858. .. rst-class:: classref-item-separator
  859. ----
  860. .. rst-class:: classref-constructor
  861. :ref:`Color<class_Color>` **Color**\ (\ from\: :ref:`Color<class_Color>`, alpha\: :ref:`float<class_float>`\ )
  862. Constructs a **Color** from the existing color, with :ref:`a<class_Color_property_a>` set to the given ``alpha`` value.
  863. .. tabs::
  864. .. code-tab:: gdscript
  865. var red = Color(Color.RED, 0.2) # 20% opaque red.
  866. .. code-tab:: csharp
  867. var red = new Color(Colors.Red, 0.2f); // 20% opaque red.
  868. .. rst-class:: classref-item-separator
  869. ----
  870. .. rst-class:: classref-constructor
  871. :ref:`Color<class_Color>` **Color**\ (\ from\: :ref:`Color<class_Color>`\ )
  872. Constructs a **Color** as a copy of the given **Color**.
  873. .. rst-class:: classref-item-separator
  874. ----
  875. .. rst-class:: classref-constructor
  876. :ref:`Color<class_Color>` **Color**\ (\ code\: :ref:`String<class_String>`\ )
  877. Constructs a **Color** either from an HTML color code or from a standardized color name. The supported color names are the same as the constants.
  878. .. rst-class:: classref-item-separator
  879. ----
  880. .. rst-class:: classref-constructor
  881. :ref:`Color<class_Color>` **Color**\ (\ code\: :ref:`String<class_String>`, alpha\: :ref:`float<class_float>`\ )
  882. Constructs a **Color** either from an HTML color code or from a standardized color name, with ``alpha`` on the range of 0.0 to 1.0. The supported color names are the same as the constants.
  883. .. rst-class:: classref-item-separator
  884. ----
  885. .. rst-class:: classref-constructor
  886. :ref:`Color<class_Color>` **Color**\ (\ r\: :ref:`float<class_float>`, g\: :ref:`float<class_float>`, b\: :ref:`float<class_float>`\ )
  887. Constructs a **Color** from RGB values, typically between 0.0 and 1.0. :ref:`a<class_Color_property_a>` is set to 1.0.
  888. .. tabs::
  889. .. code-tab:: gdscript
  890. var color = Color(0.2, 1.0, 0.7) # Similar to `Color8(51, 255, 178, 255)`
  891. .. code-tab:: csharp
  892. var color = new Color(0.2f, 1.0f, 0.7f); // Similar to `Color.Color8(51, 255, 178, 255)`
  893. .. rst-class:: classref-item-separator
  894. ----
  895. .. rst-class:: classref-constructor
  896. :ref:`Color<class_Color>` **Color**\ (\ r\: :ref:`float<class_float>`, g\: :ref:`float<class_float>`, b\: :ref:`float<class_float>`, a\: :ref:`float<class_float>`\ )
  897. Constructs a **Color** from RGBA values, typically between 0.0 and 1.0.
  898. .. tabs::
  899. .. code-tab:: gdscript
  900. var color = Color(0.2, 1.0, 0.7, 0.8) # Similar to `Color8(51, 255, 178, 204)`
  901. .. code-tab:: csharp
  902. var color = new Color(0.2f, 1.0f, 0.7f, 0.8f); // Similar to `Color.Color8(51, 255, 178, 255, 204)`
  903. .. rst-class:: classref-section-separator
  904. ----
  905. .. rst-class:: classref-descriptions-group
  906. Method Descriptions
  907. -------------------
  908. .. _class_Color_method_blend:
  909. .. rst-class:: classref-method
  910. :ref:`Color<class_Color>` **blend**\ (\ over\: :ref:`Color<class_Color>`\ ) |const| :ref:`🔗<class_Color_method_blend>`
  911. Returns a new color resulting from overlaying this color over the given color. In a painting program, you can imagine it as the ``over`` color painted over this color (including alpha).
  912. .. tabs::
  913. .. code-tab:: gdscript
  914. var bg = Color(0.0, 1.0, 0.0, 0.5) # Green with alpha of 50%
  915. var fg = Color(1.0, 0.0, 0.0, 0.5) # Red with alpha of 50%
  916. var blended_color = bg.blend(fg) # Brown with alpha of 75%
  917. .. code-tab:: csharp
  918. var bg = new Color(0.0f, 1.0f, 0.0f, 0.5f); // Green with alpha of 50%
  919. var fg = new Color(1.0f, 0.0f, 0.0f, 0.5f); // Red with alpha of 50%
  920. Color blendedColor = bg.Blend(fg); // Brown with alpha of 75%
  921. .. rst-class:: classref-item-separator
  922. ----
  923. .. _class_Color_method_clamp:
  924. .. rst-class:: classref-method
  925. :ref:`Color<class_Color>` **clamp**\ (\ min\: :ref:`Color<class_Color>` = Color(0, 0, 0, 0), max\: :ref:`Color<class_Color>` = Color(1, 1, 1, 1)\ ) |const| :ref:`🔗<class_Color_method_clamp>`
  926. Returns a new color with all components clamped between the components of ``min`` and ``max``, by running :ref:`@GlobalScope.clamp()<class_@GlobalScope_method_clamp>` on each component.
  927. .. rst-class:: classref-item-separator
  928. ----
  929. .. _class_Color_method_darkened:
  930. .. rst-class:: classref-method
  931. :ref:`Color<class_Color>` **darkened**\ (\ amount\: :ref:`float<class_float>`\ ) |const| :ref:`🔗<class_Color_method_darkened>`
  932. Returns a new color resulting from making this color darker by the specified ``amount`` (ratio from 0.0 to 1.0). See also :ref:`lightened()<class_Color_method_lightened>`.
  933. .. tabs::
  934. .. code-tab:: gdscript
  935. var green = Color(0.0, 1.0, 0.0)
  936. var darkgreen = green.darkened(0.2) # 20% darker than regular green
  937. .. code-tab:: csharp
  938. var green = new Color(0.0f, 1.0f, 0.0f);
  939. Color darkgreen = green.Darkened(0.2f); // 20% darker than regular green
  940. .. rst-class:: classref-item-separator
  941. ----
  942. .. _class_Color_method_from_hsv:
  943. .. rst-class:: classref-method
  944. :ref:`Color<class_Color>` **from_hsv**\ (\ h\: :ref:`float<class_float>`, s\: :ref:`float<class_float>`, v\: :ref:`float<class_float>`, alpha\: :ref:`float<class_float>` = 1.0\ ) |static| :ref:`🔗<class_Color_method_from_hsv>`
  945. Constructs a color from an `HSV profile <https://en.wikipedia.org/wiki/HSL_and_HSV>`__. The hue (``h``), saturation (``s``), and value (``v``) are typically between 0.0 and 1.0.
  946. .. tabs::
  947. .. code-tab:: gdscript
  948. var color = Color.from_hsv(0.58, 0.5, 0.79, 0.8)
  949. .. code-tab:: csharp
  950. var color = Color.FromHsv(0.58f, 0.5f, 0.79f, 0.8f);
  951. .. rst-class:: classref-item-separator
  952. ----
  953. .. _class_Color_method_from_ok_hsl:
  954. .. rst-class:: classref-method
  955. :ref:`Color<class_Color>` **from_ok_hsl**\ (\ h\: :ref:`float<class_float>`, s\: :ref:`float<class_float>`, l\: :ref:`float<class_float>`, alpha\: :ref:`float<class_float>` = 1.0\ ) |static| :ref:`🔗<class_Color_method_from_ok_hsl>`
  956. Constructs a color from an `OK HSL profile <https://bottosson.github.io/posts/colorpicker/>`__. The hue (``h``), saturation (``s``), and lightness (``l``) are typically between 0.0 and 1.0.
  957. .. tabs::
  958. .. code-tab:: gdscript
  959. var color = Color.from_ok_hsl(0.58, 0.5, 0.79, 0.8)
  960. .. code-tab:: csharp
  961. var color = Color.FromOkHsl(0.58f, 0.5f, 0.79f, 0.8f);
  962. .. rst-class:: classref-item-separator
  963. ----
  964. .. _class_Color_method_from_rgba8:
  965. .. rst-class:: classref-method
  966. :ref:`Color<class_Color>` **from_rgba8**\ (\ r8\: :ref:`int<class_int>`, g8\: :ref:`int<class_int>`, b8\: :ref:`int<class_int>`, a8\: :ref:`int<class_int>` = 255\ ) |static| :ref:`🔗<class_Color_method_from_rgba8>`
  967. Returns a **Color** constructed from red (``r8``), green (``g8``), blue (``b8``), and optionally alpha (``a8``) integer channels, each divided by ``255.0`` for their final value.
  968. ::
  969. var red = Color.from_rgba8(255, 0, 0) # Same as Color(1, 0, 0).
  970. var dark_blue = Color.from_rgba8(0, 0, 51) # Same as Color(0, 0, 0.2).
  971. var my_color = Color.from_rgba8(306, 255, 0, 102) # Same as Color(1.2, 1, 0, 0.4).
  972. \ **Note:** Due to the lower precision of :ref:`from_rgba8()<class_Color_method_from_rgba8>` compared to the standard **Color** constructor, a color created with :ref:`from_rgba8()<class_Color_method_from_rgba8>` will generally not be equal to the same color created with the standard **Color** constructor. Use :ref:`is_equal_approx()<class_Color_method_is_equal_approx>` for comparisons to avoid issues with floating-point precision error.
  973. .. rst-class:: classref-item-separator
  974. ----
  975. .. _class_Color_method_from_rgbe9995:
  976. .. rst-class:: classref-method
  977. :ref:`Color<class_Color>` **from_rgbe9995**\ (\ rgbe\: :ref:`int<class_int>`\ ) |static| :ref:`🔗<class_Color_method_from_rgbe9995>`
  978. Decodes a **Color** from an RGBE9995 format integer. See :ref:`Image.FORMAT_RGBE9995<class_Image_constant_FORMAT_RGBE9995>`.
  979. .. rst-class:: classref-item-separator
  980. ----
  981. .. _class_Color_method_from_string:
  982. .. rst-class:: classref-method
  983. :ref:`Color<class_Color>` **from_string**\ (\ str\: :ref:`String<class_String>`, default\: :ref:`Color<class_Color>`\ ) |static| :ref:`🔗<class_Color_method_from_string>`
  984. Creates a **Color** from the given string, which can be either an HTML color code or a named color (case-insensitive). Returns ``default`` if the color cannot be inferred from the string.
  985. If you want to create a color from String in a constant expression, use the equivalent constructor instead (i.e. ``Color("color string")``).
  986. .. rst-class:: classref-item-separator
  987. ----
  988. .. _class_Color_method_get_luminance:
  989. .. rst-class:: classref-method
  990. :ref:`float<class_float>` **get_luminance**\ (\ ) |const| :ref:`🔗<class_Color_method_get_luminance>`
  991. Returns the light intensity of the color, as a value between 0.0 and 1.0 (inclusive). This is useful when determining light or dark color. Colors with a luminance smaller than 0.5 can be generally considered dark.
  992. \ **Note:** :ref:`get_luminance()<class_Color_method_get_luminance>` relies on the color using linear encoding to return an accurate relative luminance value. If the color uses the default nonlinear sRGB encoding, use :ref:`srgb_to_linear()<class_Color_method_srgb_to_linear>` to convert it to linear encoding first.
  993. .. rst-class:: classref-item-separator
  994. ----
  995. .. _class_Color_method_hex:
  996. .. rst-class:: classref-method
  997. :ref:`Color<class_Color>` **hex**\ (\ hex\: :ref:`int<class_int>`\ ) |static| :ref:`🔗<class_Color_method_hex>`
  998. Returns the **Color** associated with the provided ``hex`` integer in 32-bit RGBA format (8 bits per channel). This method is the inverse of :ref:`to_rgba32()<class_Color_method_to_rgba32>`.
  999. In GDScript and C#, the :ref:`int<class_int>` is best visualized with hexadecimal notation (``"0x"`` prefix, making it ``"0xRRGGBBAA"``).
  1000. .. tabs::
  1001. .. code-tab:: gdscript
  1002. var red = Color.hex(0xff0000ff)
  1003. var dark_cyan = Color.hex(0x008b8bff)
  1004. var my_color = Color.hex(0xbbefd2a4)
  1005. .. code-tab:: csharp
  1006. var red = new Color(0xff0000ff);
  1007. var dark_cyan = new Color(0x008b8bff);
  1008. var my_color = new Color(0xbbefd2a4);
  1009. If you want to use hex notation in a constant expression, use the equivalent constructor instead (i.e. ``Color(0xRRGGBBAA)``).
  1010. .. rst-class:: classref-item-separator
  1011. ----
  1012. .. _class_Color_method_hex64:
  1013. .. rst-class:: classref-method
  1014. :ref:`Color<class_Color>` **hex64**\ (\ hex\: :ref:`int<class_int>`\ ) |static| :ref:`🔗<class_Color_method_hex64>`
  1015. Returns the **Color** associated with the provided ``hex`` integer in 64-bit RGBA format (16 bits per channel). This method is the inverse of :ref:`to_rgba64()<class_Color_method_to_rgba64>`.
  1016. In GDScript and C#, the :ref:`int<class_int>` is best visualized with hexadecimal notation (``"0x"`` prefix, making it ``"0xRRRRGGGGBBBBAAAA"``).
  1017. .. rst-class:: classref-item-separator
  1018. ----
  1019. .. _class_Color_method_html:
  1020. .. rst-class:: classref-method
  1021. :ref:`Color<class_Color>` **html**\ (\ rgba\: :ref:`String<class_String>`\ ) |static| :ref:`🔗<class_Color_method_html>`
  1022. Returns a new color from ``rgba``, an HTML hexadecimal color string. ``rgba`` is not case-sensitive, and may be prefixed by a hash sign (``#``).
  1023. \ ``rgba`` must be a valid three-digit or six-digit hexadecimal color string, and may contain an alpha channel value. If ``rgba`` does not contain an alpha channel value, an alpha channel value of 1.0 is applied. If ``rgba`` is invalid, returns an empty color.
  1024. .. tabs::
  1025. .. code-tab:: gdscript
  1026. var blue = Color.html("#0000ff") # blue is Color(0.0, 0.0, 1.0, 1.0)
  1027. var green = Color.html("#0F0") # green is Color(0.0, 1.0, 0.0, 1.0)
  1028. var col = Color.html("663399cc") # col is Color(0.4, 0.2, 0.6, 0.8)
  1029. .. code-tab:: csharp
  1030. var blue = Color.FromHtml("#0000ff"); // blue is Color(0.0, 0.0, 1.0, 1.0)
  1031. var green = Color.FromHtml("#0F0"); // green is Color(0.0, 1.0, 0.0, 1.0)
  1032. var col = Color.FromHtml("663399cc"); // col is Color(0.4, 0.2, 0.6, 0.8)
  1033. .. rst-class:: classref-item-separator
  1034. ----
  1035. .. _class_Color_method_html_is_valid:
  1036. .. rst-class:: classref-method
  1037. :ref:`bool<class_bool>` **html_is_valid**\ (\ color\: :ref:`String<class_String>`\ ) |static| :ref:`🔗<class_Color_method_html_is_valid>`
  1038. Returns ``true`` if ``color`` is a valid HTML hexadecimal color string. The string must be a hexadecimal value (case-insensitive) of either 3, 4, 6 or 8 digits, and may be prefixed by a hash sign (``#``). This method is identical to :ref:`String.is_valid_html_color()<class_String_method_is_valid_html_color>`.
  1039. .. tabs::
  1040. .. code-tab:: gdscript
  1041. Color.html_is_valid("#55aaFF") # Returns true
  1042. Color.html_is_valid("#55AAFF20") # Returns true
  1043. Color.html_is_valid("55AAFF") # Returns true
  1044. Color.html_is_valid("#F2C") # Returns true
  1045. Color.html_is_valid("#AABBC") # Returns false
  1046. Color.html_is_valid("#55aaFF5") # Returns false
  1047. .. code-tab:: csharp
  1048. Color.HtmlIsValid("#55AAFF"); // Returns true
  1049. Color.HtmlIsValid("#55AAFF20"); // Returns true
  1050. Color.HtmlIsValid("55AAFF"); // Returns true
  1051. Color.HtmlIsValid("#F2C"); // Returns true
  1052. Color.HtmlIsValid("#AABBC"); // Returns false
  1053. Color.HtmlIsValid("#55aaFF5"); // Returns false
  1054. .. rst-class:: classref-item-separator
  1055. ----
  1056. .. _class_Color_method_inverted:
  1057. .. rst-class:: classref-method
  1058. :ref:`Color<class_Color>` **inverted**\ (\ ) |const| :ref:`🔗<class_Color_method_inverted>`
  1059. Returns the color with its :ref:`r<class_Color_property_r>`, :ref:`g<class_Color_property_g>`, and :ref:`b<class_Color_property_b>` components inverted (``(1 - r, 1 - g, 1 - b, a)``).
  1060. .. tabs::
  1061. .. code-tab:: gdscript
  1062. var black = Color.WHITE.inverted()
  1063. var color = Color(0.3, 0.4, 0.9)
  1064. var inverted_color = color.inverted() # Equivalent to `Color(0.7, 0.6, 0.1)`
  1065. .. code-tab:: csharp
  1066. var black = Colors.White.Inverted();
  1067. var color = new Color(0.3f, 0.4f, 0.9f);
  1068. Color invertedColor = color.Inverted(); // Equivalent to `new Color(0.7f, 0.6f, 0.1f)`
  1069. .. rst-class:: classref-item-separator
  1070. ----
  1071. .. _class_Color_method_is_equal_approx:
  1072. .. rst-class:: classref-method
  1073. :ref:`bool<class_bool>` **is_equal_approx**\ (\ to\: :ref:`Color<class_Color>`\ ) |const| :ref:`🔗<class_Color_method_is_equal_approx>`
  1074. Returns ``true`` if this color and ``to`` are approximately equal, by running :ref:`@GlobalScope.is_equal_approx()<class_@GlobalScope_method_is_equal_approx>` on each component.
  1075. .. rst-class:: classref-item-separator
  1076. ----
  1077. .. _class_Color_method_lerp:
  1078. .. rst-class:: classref-method
  1079. :ref:`Color<class_Color>` **lerp**\ (\ to\: :ref:`Color<class_Color>`, weight\: :ref:`float<class_float>`\ ) |const| :ref:`🔗<class_Color_method_lerp>`
  1080. Returns the linear interpolation between this color's components and ``to``'s components. The interpolation factor ``weight`` should be between 0.0 and 1.0 (inclusive). See also :ref:`@GlobalScope.lerp()<class_@GlobalScope_method_lerp>`.
  1081. .. tabs::
  1082. .. code-tab:: gdscript
  1083. var red = Color(1.0, 0.0, 0.0)
  1084. var aqua = Color(0.0, 1.0, 0.8)
  1085. red.lerp(aqua, 0.2) # Returns Color(0.8, 0.2, 0.16)
  1086. red.lerp(aqua, 0.5) # Returns Color(0.5, 0.5, 0.4)
  1087. red.lerp(aqua, 1.0) # Returns Color(0.0, 1.0, 0.8)
  1088. .. code-tab:: csharp
  1089. var red = new Color(1.0f, 0.0f, 0.0f);
  1090. var aqua = new Color(0.0f, 1.0f, 0.8f);
  1091. red.Lerp(aqua, 0.2f); // Returns Color(0.8f, 0.2f, 0.16f)
  1092. red.Lerp(aqua, 0.5f); // Returns Color(0.5f, 0.5f, 0.4f)
  1093. red.Lerp(aqua, 1.0f); // Returns Color(0.0f, 1.0f, 0.8f)
  1094. .. rst-class:: classref-item-separator
  1095. ----
  1096. .. _class_Color_method_lightened:
  1097. .. rst-class:: classref-method
  1098. :ref:`Color<class_Color>` **lightened**\ (\ amount\: :ref:`float<class_float>`\ ) |const| :ref:`🔗<class_Color_method_lightened>`
  1099. Returns a new color resulting from making this color lighter by the specified ``amount``, which should be a ratio from 0.0 to 1.0. See also :ref:`darkened()<class_Color_method_darkened>`.
  1100. .. tabs::
  1101. .. code-tab:: gdscript
  1102. var green = Color(0.0, 1.0, 0.0)
  1103. var light_green = green.lightened(0.2) # 20% lighter than regular green
  1104. .. code-tab:: csharp
  1105. var green = new Color(0.0f, 1.0f, 0.0f);
  1106. Color lightGreen = green.Lightened(0.2f); // 20% lighter than regular green
  1107. .. rst-class:: classref-item-separator
  1108. ----
  1109. .. _class_Color_method_linear_to_srgb:
  1110. .. rst-class:: classref-method
  1111. :ref:`Color<class_Color>` **linear_to_srgb**\ (\ ) |const| :ref:`🔗<class_Color_method_linear_to_srgb>`
  1112. Returns a copy of the color that is encoded using the `nonlinear sRGB transfer function <https://en.wikipedia.org/wiki/SRGB>`__. This method requires the original color to use linear encoding. See also :ref:`srgb_to_linear()<class_Color_method_srgb_to_linear>` which performs the opposite operation.
  1113. \ **Note:** The color's :ref:`a<class_Color_property_a>`\ lpha channel is not affected. The alpha channel is always stored with linear encoding, regardless of the encoding of the other color channels.
  1114. .. rst-class:: classref-item-separator
  1115. ----
  1116. .. _class_Color_method_srgb_to_linear:
  1117. .. rst-class:: classref-method
  1118. :ref:`Color<class_Color>` **srgb_to_linear**\ (\ ) |const| :ref:`🔗<class_Color_method_srgb_to_linear>`
  1119. Returns a copy of the color that uses linear encoding. This method requires the original color to be encoded using the `nonlinear sRGB transfer function <https://en.wikipedia.org/wiki/SRGB>`__. See also :ref:`linear_to_srgb()<class_Color_method_linear_to_srgb>` which performs the opposite operation.
  1120. \ **Note:** The color's :ref:`a<class_Color_property_a>`\ lpha channel is not affected. The alpha channel is always stored with linear encoding, regardless of the encoding of the other color channels.
  1121. .. rst-class:: classref-item-separator
  1122. ----
  1123. .. _class_Color_method_to_abgr32:
  1124. .. rst-class:: classref-method
  1125. :ref:`int<class_int>` **to_abgr32**\ (\ ) |const| :ref:`🔗<class_Color_method_to_abgr32>`
  1126. Returns the color converted to a 32-bit integer in ABGR format (each component is 8 bits). ABGR is the reversed version of the default RGBA format.
  1127. .. tabs::
  1128. .. code-tab:: gdscript
  1129. var color = Color(1, 0.5, 0.2)
  1130. print(color.to_abgr32()) # Prints 4281565439
  1131. .. code-tab:: csharp
  1132. var color = new Color(1.0f, 0.5f, 0.2f);
  1133. GD.Print(color.ToAbgr32()); // Prints 4281565439
  1134. .. rst-class:: classref-item-separator
  1135. ----
  1136. .. _class_Color_method_to_abgr64:
  1137. .. rst-class:: classref-method
  1138. :ref:`int<class_int>` **to_abgr64**\ (\ ) |const| :ref:`🔗<class_Color_method_to_abgr64>`
  1139. Returns the color converted to a 64-bit integer in ABGR format (each component is 16 bits). ABGR is the reversed version of the default RGBA format.
  1140. .. tabs::
  1141. .. code-tab:: gdscript
  1142. var color = Color(1, 0.5, 0.2)
  1143. print(color.to_abgr64()) # Prints -225178692812801
  1144. .. code-tab:: csharp
  1145. var color = new Color(1.0f, 0.5f, 0.2f);
  1146. GD.Print(color.ToAbgr64()); // Prints -225178692812801
  1147. .. rst-class:: classref-item-separator
  1148. ----
  1149. .. _class_Color_method_to_argb32:
  1150. .. rst-class:: classref-method
  1151. :ref:`int<class_int>` **to_argb32**\ (\ ) |const| :ref:`🔗<class_Color_method_to_argb32>`
  1152. Returns the color converted to a 32-bit integer in ARGB format (each component is 8 bits). ARGB is more compatible with DirectX.
  1153. .. tabs::
  1154. .. code-tab:: gdscript
  1155. var color = Color(1, 0.5, 0.2)
  1156. print(color.to_argb32()) # Prints 4294934323
  1157. .. code-tab:: csharp
  1158. var color = new Color(1.0f, 0.5f, 0.2f);
  1159. GD.Print(color.ToArgb32()); // Prints 4294934323
  1160. .. rst-class:: classref-item-separator
  1161. ----
  1162. .. _class_Color_method_to_argb64:
  1163. .. rst-class:: classref-method
  1164. :ref:`int<class_int>` **to_argb64**\ (\ ) |const| :ref:`🔗<class_Color_method_to_argb64>`
  1165. Returns the color converted to a 64-bit integer in ARGB format (each component is 16 bits). ARGB is more compatible with DirectX.
  1166. .. tabs::
  1167. .. code-tab:: gdscript
  1168. var color = Color(1, 0.5, 0.2)
  1169. print(color.to_argb64()) # Prints -2147470541
  1170. .. code-tab:: csharp
  1171. var color = new Color(1.0f, 0.5f, 0.2f);
  1172. GD.Print(color.ToArgb64()); // Prints -2147470541
  1173. .. rst-class:: classref-item-separator
  1174. ----
  1175. .. _class_Color_method_to_html:
  1176. .. rst-class:: classref-method
  1177. :ref:`String<class_String>` **to_html**\ (\ with_alpha\: :ref:`bool<class_bool>` = true\ ) |const| :ref:`🔗<class_Color_method_to_html>`
  1178. Returns the color converted to an HTML hexadecimal color :ref:`String<class_String>` in RGBA format, without the hash (``#``) prefix.
  1179. Setting ``with_alpha`` to ``false``, excludes alpha from the hexadecimal string, using RGB format instead of RGBA format.
  1180. .. tabs::
  1181. .. code-tab:: gdscript
  1182. var white = Color(1, 1, 1, 0.5)
  1183. var with_alpha = white.to_html() # Returns "ffffff7f"
  1184. var without_alpha = white.to_html(false) # Returns "ffffff"
  1185. .. code-tab:: csharp
  1186. var white = new Color(1, 1, 1, 0.5f);
  1187. string withAlpha = white.ToHtml(); // Returns "ffffff7f"
  1188. string withoutAlpha = white.ToHtml(false); // Returns "ffffff"
  1189. .. rst-class:: classref-item-separator
  1190. ----
  1191. .. _class_Color_method_to_rgba32:
  1192. .. rst-class:: classref-method
  1193. :ref:`int<class_int>` **to_rgba32**\ (\ ) |const| :ref:`🔗<class_Color_method_to_rgba32>`
  1194. Returns the color converted to a 32-bit integer in RGBA format (each component is 8 bits). RGBA is Godot's default format. This method is the inverse of :ref:`hex()<class_Color_method_hex>`.
  1195. .. tabs::
  1196. .. code-tab:: gdscript
  1197. var color = Color(1, 0.5, 0.2)
  1198. print(color.to_rgba32()) # Prints 4286526463
  1199. .. code-tab:: csharp
  1200. var color = new Color(1, 0.5f, 0.2f);
  1201. GD.Print(color.ToRgba32()); // Prints 4286526463
  1202. .. rst-class:: classref-item-separator
  1203. ----
  1204. .. _class_Color_method_to_rgba64:
  1205. .. rst-class:: classref-method
  1206. :ref:`int<class_int>` **to_rgba64**\ (\ ) |const| :ref:`🔗<class_Color_method_to_rgba64>`
  1207. Returns the color converted to a 64-bit integer in RGBA format (each component is 16 bits). RGBA is Godot's default format. This method is the inverse of :ref:`hex64()<class_Color_method_hex64>`.
  1208. .. tabs::
  1209. .. code-tab:: gdscript
  1210. var color = Color(1, 0.5, 0.2)
  1211. print(color.to_rgba64()) # Prints -140736629309441
  1212. .. code-tab:: csharp
  1213. var color = new Color(1, 0.5f, 0.2f);
  1214. GD.Print(color.ToRgba64()); // Prints -140736629309441
  1215. .. rst-class:: classref-section-separator
  1216. ----
  1217. .. rst-class:: classref-descriptions-group
  1218. Operator Descriptions
  1219. ---------------------
  1220. .. _class_Color_operator_neq_Color:
  1221. .. rst-class:: classref-operator
  1222. :ref:`bool<class_bool>` **operator !=**\ (\ right\: :ref:`Color<class_Color>`\ ) :ref:`🔗<class_Color_operator_neq_Color>`
  1223. Returns ``true`` if the colors are not exactly equal.
  1224. \ **Note:** Due to floating-point precision errors, consider using :ref:`is_equal_approx()<class_Color_method_is_equal_approx>` instead, which is more reliable.
  1225. .. rst-class:: classref-item-separator
  1226. ----
  1227. .. _class_Color_operator_mul_Color:
  1228. .. rst-class:: classref-operator
  1229. :ref:`Color<class_Color>` **operator ***\ (\ right\: :ref:`Color<class_Color>`\ ) :ref:`🔗<class_Color_operator_mul_Color>`
  1230. Multiplies each component of the **Color** by the components of the given **Color**.
  1231. .. rst-class:: classref-item-separator
  1232. ----
  1233. .. _class_Color_operator_mul_float:
  1234. .. rst-class:: classref-operator
  1235. :ref:`Color<class_Color>` **operator ***\ (\ right\: :ref:`float<class_float>`\ ) :ref:`🔗<class_Color_operator_mul_float>`
  1236. Multiplies each component of the **Color** by the given :ref:`float<class_float>`.
  1237. .. rst-class:: classref-item-separator
  1238. ----
  1239. .. _class_Color_operator_mul_int:
  1240. .. rst-class:: classref-operator
  1241. :ref:`Color<class_Color>` **operator ***\ (\ right\: :ref:`int<class_int>`\ ) :ref:`🔗<class_Color_operator_mul_int>`
  1242. Multiplies each component of the **Color** by the given :ref:`int<class_int>`.
  1243. .. rst-class:: classref-item-separator
  1244. ----
  1245. .. _class_Color_operator_sum_Color:
  1246. .. rst-class:: classref-operator
  1247. :ref:`Color<class_Color>` **operator +**\ (\ right\: :ref:`Color<class_Color>`\ ) :ref:`🔗<class_Color_operator_sum_Color>`
  1248. Adds each component of the **Color** with the components of the given **Color**.
  1249. .. rst-class:: classref-item-separator
  1250. ----
  1251. .. _class_Color_operator_dif_Color:
  1252. .. rst-class:: classref-operator
  1253. :ref:`Color<class_Color>` **operator -**\ (\ right\: :ref:`Color<class_Color>`\ ) :ref:`🔗<class_Color_operator_dif_Color>`
  1254. Subtracts each component of the **Color** by the components of the given **Color**.
  1255. .. rst-class:: classref-item-separator
  1256. ----
  1257. .. _class_Color_operator_div_Color:
  1258. .. rst-class:: classref-operator
  1259. :ref:`Color<class_Color>` **operator /**\ (\ right\: :ref:`Color<class_Color>`\ ) :ref:`🔗<class_Color_operator_div_Color>`
  1260. Divides each component of the **Color** by the components of the given **Color**.
  1261. .. rst-class:: classref-item-separator
  1262. ----
  1263. .. _class_Color_operator_div_float:
  1264. .. rst-class:: classref-operator
  1265. :ref:`Color<class_Color>` **operator /**\ (\ right\: :ref:`float<class_float>`\ ) :ref:`🔗<class_Color_operator_div_float>`
  1266. Divides each component of the **Color** by the given :ref:`float<class_float>`.
  1267. .. rst-class:: classref-item-separator
  1268. ----
  1269. .. _class_Color_operator_div_int:
  1270. .. rst-class:: classref-operator
  1271. :ref:`Color<class_Color>` **operator /**\ (\ right\: :ref:`int<class_int>`\ ) :ref:`🔗<class_Color_operator_div_int>`
  1272. Divides each component of the **Color** by the given :ref:`int<class_int>`.
  1273. .. rst-class:: classref-item-separator
  1274. ----
  1275. .. _class_Color_operator_eq_Color:
  1276. .. rst-class:: classref-operator
  1277. :ref:`bool<class_bool>` **operator ==**\ (\ right\: :ref:`Color<class_Color>`\ ) :ref:`🔗<class_Color_operator_eq_Color>`
  1278. Returns ``true`` if the colors are exactly equal.
  1279. \ **Note:** Due to floating-point precision errors, consider using :ref:`is_equal_approx()<class_Color_method_is_equal_approx>` instead, which is more reliable.
  1280. .. rst-class:: classref-item-separator
  1281. ----
  1282. .. _class_Color_operator_idx_int:
  1283. .. rst-class:: classref-operator
  1284. :ref:`float<class_float>` **operator []**\ (\ index\: :ref:`int<class_int>`\ ) :ref:`🔗<class_Color_operator_idx_int>`
  1285. Access color components using their index. ``[0]`` is equivalent to :ref:`r<class_Color_property_r>`, ``[1]`` is equivalent to :ref:`g<class_Color_property_g>`, ``[2]`` is equivalent to :ref:`b<class_Color_property_b>`, and ``[3]`` is equivalent to :ref:`a<class_Color_property_a>`.
  1286. .. rst-class:: classref-item-separator
  1287. ----
  1288. .. _class_Color_operator_unplus:
  1289. .. rst-class:: classref-operator
  1290. :ref:`Color<class_Color>` **operator unary+**\ (\ ) :ref:`🔗<class_Color_operator_unplus>`
  1291. Returns the same value as if the ``+`` was not there. Unary ``+`` does nothing, but sometimes it can make your code more readable.
  1292. .. rst-class:: classref-item-separator
  1293. ----
  1294. .. _class_Color_operator_unminus:
  1295. .. rst-class:: classref-operator
  1296. :ref:`Color<class_Color>` **operator unary-**\ (\ ) :ref:`🔗<class_Color_operator_unminus>`
  1297. Inverts the given color. This is equivalent to ``Color.WHITE - c`` or ``Color(1 - c.r, 1 - c.g, 1 - c.b, 1 - c.a)``. Unlike with :ref:`inverted()<class_Color_method_inverted>`, the :ref:`a<class_Color_property_a>` component is inverted, too.
  1298. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  1299. .. |required| replace:: :abbr:`required (This method is required to be overridden when extending its base class.)`
  1300. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  1301. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  1302. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  1303. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  1304. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`
  1305. .. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)`
  1306. .. |void| replace:: :abbr:`void (No return value.)`