class_color.rst 82 KB

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