Thread: Color Cycle
View Single Post
  #7  
Old 05-15-2008, 01:35 AM
Tigairius Tigairius is offline
The Cat
Tigairius's Avatar
Join Date: Jan 2007
Location: Missouri, USA
Posts: 4,240
Tigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant future
Quote:
Originally Posted by zokemon View Post
Seems to only support hue? What about saturation and luminosity?
Added it in for you

Below is an example of hue, saturation and luminosity.
PHP Code:
//#CLIENTSIDE
function onCreated() {
  
this.a = 0.99;
  
this.sat = 0;
  
this.mx = {15, 0};
  
temp.p = {screenwidth / 2, screenheight / 2};

  
showimg(200, "light4.png", 200, 200);
  
changeimgvis(200, 4);
  
temp.color = colorcycle(this.mx[0]);
  
changeimgcolors(200, color[0] - color[0] / 2 + this.sat, color[1] - color[1] / 2 + this.sat, color[2] - color[2] / 2 + this.sat, this.a);

  
onCreateColor();
  
onTimeout();
}

function 
onCreateColor() {
  new 
GuiWindowCtrl("Color_Window1") {
    
profile = GuiBlueWindowProfile;
    
clientrelative = true;
    
clientextent = "90,164";

    
canmaximize = false;
    
canminimize = false;
    
canmove = true;
    
canresize = false;
    
closequery = false;
    
destroyonhide = false;
    
text = "Color";
    
x = 50;
    
y = 50;

    new 
GuiShowImgCtrl("Color_Table") {
      
x = y = 0;
      
width = height = 90;
      
image = "tig-colortab.png";
    }
    new 
GuiShowImgCtrl("Color_Cursor") {
      
x = y = 0;
      
image = "tig-colorcursor.png";
    }
    new 
GuiSliderCtrl("Color_Slider1") {
      
profile = GuiBlueSliderProfile;
      
height = 20;
      
range = "0,80";
      
ticks = 80;
      
value = 80;
      
width = 77;
      
x = 7;
      
y = 107;
    }
    new 
GuiTextCtrl("Color_Text1") {
      
profile = GuiBlueTextProfile;
      
height = 20;
      
text = "Saturation:";
      
width = 52;
      
x = 7;
      
y = 90;
    }
    new 
GuiTextCtrl("Color_Text2") {
      
profile = GuiBlueTextProfile;
      
height = 20;
      
text = "Luminosity:";
      
width = 60;
      
x = 10;
      
y = 120;
    }
    new 
GuiSliderCtrl("Color_Slider2") {
      
profile = GuiBlueSliderProfile;
      
height = 20;
      
range = "0,99";
      
ticks = 99;
      
value = 99;
      
width = 77;
      
x = 7;
      
y = 141;
    }
  }
}

function 
Color_Slider2.onReleaseSlider(value) {
  
this.a = value / 100;
  
temp.color = colorcycle(this.mx[0]);
  
changeimgcolors(200, color[0] - color[0] / 2 + this.sat, color[1] - color[1] / 2 + this.sat, color[2] - color[2] / 2 + this.sat, this.a);
}

function 
Color_Slider1.onReleaseSlider(value) {
  
this.sat = 1 - abs(value / 100);
  
temp.color = colorcycle(this.mx[0]);
  
changeimgcolors(200, color[0] - color[0] / 2 + this.sat, color[1] - color[1] / 2 + this.sat, color[2] - color[2] / 2 + this.sat, this.a);
}

function 
onTimeout() {
  if (
leftmousebuttonglobal) {
    if (
mousescreenx in |Color_Window1.x + 6, Color_Window1.x + Color_Table.width + 7| &&
      
mousescreeny in |Color_Window1.y + 24, Color_Window1.y + 115|) {
      
this.mx = Color_Table.globaltolocalcoord({mousescreenx, mousescreeny});
      
Color_Cursor.x = this.mx[0] - 6;
      
Color_Cursor.y = this.mx[1] - 6;
      
temp.color = colorcycle(this.mx[0]);
      
changeimgcolors(200, color[0] - color[0] / 2 + this.sat, color[1] - color[1] / 2 + this.sat, color[2] - color[2] / 2 + this.sat, this.a);
    }
  }
  
setTimer(0.05);
} 
__________________


“Shoot for the moon. Even if you miss, you'll land among the stars.”
Reply With Quote