class_color.rst 84 KB

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