=========
TKE_Color
=========

Opcode
======

.. csv-table::

	"ASCII", "(double quote)"
	"Hexadecimal", "22"
	"Decimal", "34"
	
	
Operands
========

| Variable geometry, Variable channels,
| [Variable diffuse], [Variable specular], 
| [Variable mirror], [Variable transmission], [
| Variable emission], [Float gloss], [Float index], 
| [Variable environment], [Variable bump] 

Note: all of the optional **Variable** fields are of this format:

| Byte length,
| 
| if length = 0:
| (3)xByte rgb
| 
| if length > 0:
| (length)xByte string


.. csv-table::

	"geometry", "bitmask of affected geometry. 1 byte, if high bit set one or more bytes follow. bit definitions are :doc:`here </general/hsf/opcodes/geometry_table>`"
	"channels", "color components of specified geometry types. 1 byte, if high bit set a second byte follows"
	"diffuse", "basic color of the objects"
	"specular", "color modulation applied to directly reflected lights"
	"mirror", "color modulation applied to indirectly reflected light, such as form an environment map or during ray-tracing"
	"transmission", "color modulation applied to light passing through the object"
	"emission", "color supplied directly by the object"
	"gloss", "shininess of the object"
	"index", "index of refraction of the object (may be useful with ray-tracing)"
	"environment", "environment map applied to the object"
	"bump", "bump map applied to the object"
	

Notes
=====

This is the color which will apply to geometry in the currently opened segment/geometry. For detailed information on what this means in the HOOPS/3dGS refer to the ``Set_Color`` specification in the 3dGS Reference Manual.

Most color components may be either a simple RGB triplet (values scaled from 0-255) or a string description (such as "light blue" or "brick").


Channel bits
============

.. raw:: html

	<table BORDER =1 WIDTH="330">
	  <TR> 
		<TD height=21 width=50>0001</TD>
		<TD height=21 width=190>Diffuse</TD>
	  </TR>
	  <TR> 
		<TD height=21 width=50>0002</TD>
		<TD height=21 width=190>Specular</TD>
	  </TR>
	  <TR> 
		<TD height=21 width=50>0004</TD>
		<TD height=21 width=190>Mirror</TD>
	  </TR>
	  <TR> 
		<TD height=21 width=50>0008</TD>
		<TD height=21 width=190>Transmission</TD>
	  </TR>
	  <TR> 
		<TD height=21 width=50>0010</TD>
		<TD height=21 width=190>Emission</TD>
	  </TR>
	  <TR> 
		<TD height=21 width=50>0020</TD>
		<TD height=21 width=190>Gloss</TD>
	  </TR>
	  <TR> 
		<TD height=21 width=50>0040</TD>
		<TD height=21 width=190>Index</TD>
	  </TR>
	  <TR> 
		<TD height=21 width=50>0080</TD>
		<TD height=21 width=190>indicates additional byte required</TD>
	  </TR>
	  <TR> 
		<TD height=21 width=50>0100</TD>
		<TD height=21 width=190>Environment</TD>
	  </TR>
	  <TR> 
		<TD height=21 width=50>0200</TD>
		<TD height=21 width=190>Bump</TD>
	  </TR>
	</table>
