This is a read-only mirror of pymolwiki.org

Difference between revisions of "Set Color"

From PyMOL Wiki
Jump to navigation Jump to search
 
m (1 revision)
 
(8 intermediate revisions by 5 users not shown)
Line 1: Line 1:
===DESCRIPTION===
+
[[Set_Color]] defines a new color with color indices (0.0-1.0). Numbers between 0 an 255 can be used as well. (If at least one value is larger than 1, pymol will interpret all 3 values as between 0 and 255). If an existing color name is used, the old color will be overridden.
'''set_color''' defines a new color with color indices (0.0-1.0)
 
  
 
===USAGE===
 
===USAGE===
 
<source lang="python">
 
<source lang="python">
set_color name, [ red-float, green-float, blue-float ]
+
set_color name, [ red-float, green-float, blue-float ]
set_color name = [ red-float, green-float, blue-float ]  #(DEPRECATED)
+
set_color name = [ red-float, green-float, blue-float ]  #(DEPRECATED)
 
</source>
 
</source>
 +
 
===PYMOL API===
 
===PYMOL API===
 
<source lang="python">
 
<source lang="python">
Line 13: Line 13:
  
 
===EXAMPLES===
 
===EXAMPLES===
set_color red, [ 1.0, 0.0, 0.0 ]
+
<source lang="python">
 +
PyMOL>set_color red, [1,0.01,0.01]
 +
Color: "red" defined as [ 1.000, 0.010, 0.010 ].
 +
PyMOL>set_color khaki, [195,176,145]
 +
Color: "khaki" defined as [ 0.765, 0.690, 0.569 ].
 +
</source>
 +
 
 +
These will be added to the end of the list of Pymol's color indices that you can view the [[Get Color Indices]] command.
 +
 
 +
== See Also ==
 +
* [[Get_Color_Tuples]]
 +
* [[set_object_color]]
  
[[Category:Commands|set_color]]
+
[[Category:Commands|Set Color]]
 +
[[Category:Coloring|Set Color]]

Latest revision as of 18:49, 14 October 2019

Set_Color defines a new color with color indices (0.0-1.0). Numbers between 0 an 255 can be used as well. (If at least one value is larger than 1, pymol will interpret all 3 values as between 0 and 255). If an existing color name is used, the old color will be overridden.

USAGE

set_color name, [ red-float, green-float, blue-float ]
set_color name = [ red-float, green-float, blue-float ]  #(DEPRECATED)

PYMOL API

cmd.set_color( string name, float-list rgb )

EXAMPLES

PyMOL>set_color red, [1,0.01,0.01]
 Color: "red" defined as [ 1.000, 0.010, 0.010 ].
PyMOL>set_color khaki, [195,176,145]
 Color: "khaki" defined as [ 0.765, 0.690, 0.569 ].

These will be added to the end of the list of Pymol's color indices that you can view the Get Color Indices command.

See Also