class_color.rst 84 KB

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