home *** CD-ROM | disk | FTP | other *** search
/ Sony Community Place / circus2e.exe / DATA.Z / generatecolor.java < prev    next >
Text File  |  1996-09-25  |  4KB  |  181 lines

  1. //
  2. // GenerateColor.java
  3. //    generate SFColor for ColorPanel
  4. //
  5. // (c) Copyright 1996 Sony Corporation. All rights reserved.
  6.  
  7. import vs.*;
  8.  
  9. class GenerateColor{
  10.     public static float[] getSFColor( int code ){
  11.     float f[] = new float[3];
  12.  
  13.     switch( code ){
  14.     case( 0 ):
  15.             f[0] = 0.0f;
  16.             f[1] = 0.0f;
  17.             f[2] = 0.0f;        
  18.         break;
  19.  
  20.     case( 1 ):
  21.             f[0] = 0.0f;
  22.             f[1] = 0.0f;
  23.             f[2] = 1.0f;        
  24.         break;
  25.     case( 2 ):
  26.             f[0] = 0.0f;
  27.             f[1] = 1.0f;
  28.             f[2] = 0.0f;        
  29.         break;
  30.     case( 3 ):
  31.             f[0] = 0.0f;
  32.             f[1] = 1.0f;
  33.             f[2] = 1.0f;        
  34.         break;
  35.     case( 4 ):
  36.             f[0] = 1.0f;
  37.             f[1] = 0.0f;
  38.             f[2] = 0.0f;        
  39.         break;
  40.     case( 5 ):
  41.             f[0] = 1.0f;
  42.             f[1] = 0.0f;
  43.             f[2] = 1.0f;        
  44.         break;
  45.     case( 6 ):
  46.             f[0] = 1.0f;
  47.             f[1] = 1.0f;
  48.             f[2] = 0.0f;        
  49.         break;
  50.     case( 7 ):
  51.             f[0] = 1.0f;
  52.             f[1] = 1.0f;
  53.             f[2] = 1.0f;        
  54.         break;
  55.     case( 8 ):
  56.             f[0] = 0.5f;
  57.             f[1] = 0.4f;
  58.             f[2] = 0.3f;        
  59.         break;
  60.     case( 9 ):
  61.             f[0] = 0.0f;
  62.             f[1] = 0.0f;
  63.             f[2] = 0.6f;        
  64.         break;
  65.     case( 10 ):
  66.             f[0] = 0.0f;
  67.             f[1] = 0.6f;
  68.             f[2] = 0.0f;        
  69.         break;
  70.     case( 11 ):
  71.             f[0] = 0.0f;
  72.             f[1] = 0.6f;
  73.             f[2] = 0.6f;        
  74.         break;
  75.     case( 12 ):
  76.             f[0] = 0.6f;
  77.             f[1] = 0.0f;
  78.             f[2] = 0.0f;        
  79.         break;
  80.     case( 13 ):
  81.             f[0] = 0.6f;
  82.             f[1] = 0.0f;
  83.             f[2] = 0.6f;        
  84.         break;
  85.     case( 14 ):
  86.             f[0] = 0.6f;
  87.             f[1] = 0.6f;
  88.             f[2] = 0.0f;        
  89.         break;
  90.     case( 15 ):
  91.             f[0] = 0.6f;
  92.             f[1] = 0.6f;
  93.             f[2] = 0.6f;
  94.         break;
  95.     case( 16 ):
  96.             f[0] = 0.9f;
  97.             f[1] = 0.8f;
  98.             f[2] = 0.7f;
  99.         break;
  100.     case( 17 ):
  101.             f[0] = 0.8f;
  102.             f[1] = 0.7f;
  103.             f[2] = 0.5f;
  104.         break;
  105.     default:
  106.             f[0] = 0.0f;
  107.             f[1] = 0.0f;
  108.             f[2] = 0.0f;
  109.         break;
  110.     }
  111.     return f;
  112.     }
  113.  
  114.     //
  115.     // get default color
  116.     // 
  117.     public static float[] getDefaultColor( int no, int doll_no ){
  118.  
  119.         float boy_defaultcolor[][] = {
  120.         { 1.0f, 0.787f, 0.59f }, 
  121.         { 1.0f, 1.0f, 1.0f } ,
  122.         { 0.0f,  1.0f, 0.617f } ,
  123.         { 1.0f, 0.788f, 0.592f },
  124.         { 1.0f, 0.787f, 0.59f },
  125.         { 1.0f, 0.49f, 0.0f },
  126.         { 0.22f, 0.345f, 1.0f },
  127.         { 0.22f, 0.345f, 1.0f },
  128.         { 0.625f, 0.625f, 0.625f },
  129.         { 0.225f, 0.334f, 1.0f },
  130.         { 0.22f, 0.345f, 1.0f },
  131.         { 0.625f, 0.625f, 0.625f },
  132.         { 0.0f, 1.0f, 0.618f },
  133.         { 1.0f, 0.787f, 0.59f },
  134.         { 1.25f, 0.981f, 0.732f },
  135.         { 0.0f, 1.0f, 0.626f },
  136.         { 1.0f, 0.787f, 0.59f },
  137.         { 0.0f, 0.0f, 0.0f }        // dummy
  138.         };
  139.         float girl_defaultcolor[][] = {
  140.         { 0.672f, 0.0f, 1.0f },
  141.         { 1.0f, 1.0f, 1.0f },
  142.         { 0.0f, 0.08f, 1.0f },
  143.         { 1.0f, 0f, 0.371f },
  144.         { 1.0f, 0.757f, 0.48f },
  145.         { 1.0f, 0.748f, 0.479f },
  146.         { 1.0f, 0.564f, 0f },
  147.         { 1.0f, 0.761f, 0.48f },
  148.         { 1.0f, 0.763f, 0.48f },
  149.         { 0.953f, 0.725f, 0.457f },
  150.         { 1.0f, 0.761f, 0.48f },
  151.         { 1.0f, 0.761f, 0.48f },
  152.         { 1.0f, 0.761f, 0.48f },
  153.         { 0.663f, 0.0f, 1.0f },
  154.         { 0.684f, 0.0f, 1.0f },
  155.         { 0.703f, 0.0f, 1.0f },
  156.         { 0.696f, 0.0f, 1.0f },
  157.         { 0.674f, 0.0f, 1.0f }
  158.         };
  159.  
  160.         float f[] = new float[3];
  161.  
  162.         if( doll_no == 0 ){
  163.             f[0] = boy_defaultcolor[ no ][ 0 ];
  164.             f[1] = boy_defaultcolor[ no ][ 1 ];
  165.             f[2] = boy_defaultcolor[ no ][ 2 ];
  166.         }
  167.         if( doll_no == 1 ){
  168.             f[0] = girl_defaultcolor[ no ][ 0 ];
  169.             f[1] = girl_defaultcolor[ no ][ 1 ];
  170.             f[2] = girl_defaultcolor[ no ][ 2 ];
  171.         }
  172.         else {
  173.             f[0] = boy_defaultcolor[ no ][ 0 ];
  174.             f[1] = boy_defaultcolor[ no ][ 1 ];
  175.             f[2] = boy_defaultcolor[ no ][ 2 ];
  176.         }
  177.         return f;
  178.     }
  179. }
  180.  
  181.