Jump to content
Sign in to follow this  
TrashBoat

How can i make a rainbow color function?

Recommended Posts

TrashBoat

Could someone help me create or give an idea of how to do a incrementing for loop that would do this: https://i.imgur.com/YFUt47H.gifv

I'm having a hard time figuring it out :S

Share this post


Link to post
Share on other sites
bernd670
Posted (edited)

Hello,

you can use multiple whileloops

Spoiler
#include <Color.au3>

Local $RGB[] = [ 255, 0 , 0]
Local $SleepTime = 10

$hGUI = GUICreate("test", 100, 100)
GUISetBkColor(_ColorSetRGB($RGB), $hGUI)
GUISetState(@SW_SHOW)

For $i = 1 To 10
    While $RGB[1] < 255
        $RGB[1] += 1
        GUISetBkColor(_ColorSetRGB($RGB), $hGUI)
        Sleep($SleepTime)
    WEnd

    While $RGB[0] > 0
        $RGB[0] -= 1
        GUISetBkColor(_ColorSetRGB($RGB), $hGUI)
        Sleep($SleepTime)
    WEnd

    While $RGB[2] < 255
        $RGB[2] += 1
        GUISetBkColor(_ColorSetRGB($RGB), $hGUI)
        Sleep($SleepTime)
    WEnd

    While $RGB[1] > 0
        $RGB[1] -= 1
        GUISetBkColor(_ColorSetRGB($RGB), $hGUI)
        Sleep($SleepTime)
    WEnd

    While $RGB[0] < 255
        $RGB[0] += 1
        GUISetBkColor(_ColorSetRGB($RGB), $hGUI)
        Sleep($SleepTime)
    WEnd

    While $RGB[2] > 0
        $RGB[2] -= 1
        GUISetBkColor(_ColorSetRGB($RGB), $hGUI)
        Sleep($SleepTime)
    WEnd
Next

 

 

Edited by bernd670
  • Thanks 1

greetings
bernd


I hacked 127.0.0.1 -> pcfred6.gif

Share this post


Link to post
Share on other sites
TrashBoat
40 minutes ago, bernd670 said:

Hello,

you can use multiple whileloops

Thanks! That works perfectly

Share this post


Link to post
Share on other sites
UEZ
Posted (edited)

Might also help using HSL color space:

 

Edited by UEZ

Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Similar Content

    • nooneclose
      By nooneclose
      How to use _Excel_RangeSort to sort my excel file by three different headers Column A1, B1, and C1 have headers on which I want to sort by. The headers on which I want to sort are department, employee type, and name.
      I still really new to AutoIt so I do not actually know how to properly start this line or lines of code, to be honest. The example code is the best I can do.
      _Excel_RangeSort($OpenWorkbook, Default, "A1:C1", "1:1", $xlDescending, Default, $xlYes, Default, $xlSortRows) I just need to sort by those three headers in that order of department, employee type, and name, plus in descending order.
       
      any and all help would be greatly appreciated.  Thank you!
    • Eminence
      By Eminence
      Hello,
      Using SQLite, I was trying to select a specific column with having duplicate entries removed by using the DISTINCT function. 
      Local $sQuery = "SELECT DISTINCT supervisor, COUNT(DISTINCT employee_name) FROM data_db What the above snippet does is just list only one supervisor but with the total count of unique employee names in the whole database when it should be listing out all supervisor entries from the database and list the total count of employees per each supervisors. If I remove the COUNT function, it does list out all unique entries of supervisor names from the list. Attached is a screenshot of an example database as well. 
      Any help will be much appreciated. Thank you!

    • PramodR
      By PramodR
       
      I see couple of ways to import module ,  one with specifying absolute path of the file to get imported, by this logic i believe to import a specific module will be like #include <c:\modulepath\duplicatemodule.au3>
      but i see some registry changes also made in this link , can someone explain why that registry change is really required.
       
    • fikri
      By fikri
      Hello to all.
      I would like to make automation for LabView compiled project exe.
      Actually I just need to get values (results) from labview textboxes. But since labview not using MS componenents, is that possible.
      I spend lot of time by googling and tried some scripts but without success.
      Is this possible at all? 
      Also, I cannot read text properties window by any spy tool?  
       
      here is what I have from AutoIt Info:
       
      Class: LVDChild
      Position: -8, -8
      Size: 1456, 876
      Style: 0x17CF0000
      ExStyle: 0x00040300
      Handle: 0x001F041C >>>> Control <<<<
      Class: 
      Instance: 
      ClassnameNN: 
      Name: 
      Advanced (Class): 
      ID: 
      Text: 
      Position: 
      Size: 
      ControlClick Coords: 
      Style: 
      ExStyle: 
      Handle:  >>>> Mouse <<<<
      Position: 1256, 267
      Cursor ID: 0
      Color: 0xFAFAFA >>>> StatusBar <<<< >>>> ToolsBar <<<< >>>> Visible Text <<<<
      >>>> Hidden Text <<<<
    • toto22
      By toto22
      I have a string that look like this:

      WIFI    13.8    26.59
      BCRX    9.6    13.34
      GTES    8.5    11.15
      DFRG    5.9    33.02
      GIL    5.5    12.08
      How can I simply build an Array with it?
       
×