Jump to content

Extended Color Mixer - a little helper


Edano
 Share

Recommended Posts

Extended Color Mixer

i want to share one of my little helpers. - what does it do ?

RGB color system is the mathematical description of colors, so to say, it explains colors (a sensual impression) to a machine. in contrast to that, the human eye interprets colors in the HSL (hue-saturation-luminance) matrix.

these two systems are not much compatible. if you want to use "neighbour" colors in a gui, or very distant colors for more contrast (e.g. in games), the tuning on the Red-Green-Blue scale rarely returns satisfying results and it is very hard to compare colors to find out the most suitable.

so i took the well known windows colorpicker, which uses HSL system, and extended it. the HSL square displays colors according to the hue on the horzontal and saturation on the vertical axis. the luminance is the "third dimension" slider to the right of it. so, HSL is a 3D model of colors, while RGB is 2 dimensional, a triangle with Red Green and Blue at the edges.

i amended sliders for the RGB color scale on the right to the colorpicker window. the color you pick is displayed in the central "base color" label. to the bottom of the window i added an array in which related colors to the base color will be created.

basically you have to choose if you want to create similar or "distant" colors to the base color. you can choose a threshold that represents the min/max distance to the base color. additionally, you can choose the standard for the distance calculation. the euclidean distance simply is the spacial distance in the RGB room. the industry defined some weighting standards of the colors to fit better to the human eye's sensation (NTSC, HDTV, HSP a.o.). additionally you can set up saturation and luminance filters to precise your search.

the mixer puts the chosen color in Hexcode into your clipboard. if you keep the ctrl button pressed, all colors you pick will be collected. you can toggle the clipboard function off by clicking on the clipboard statusbar label, and restore your old clipboard content.

the two buttons "Collect All" and "OK" have no function that i know of, it is an "unfinished project" :)

now you can try it out and play around.

i have often used the modified "Shades()" function in other scripts to create desired colors within a program. feel free to use the algorithms.

.

taken down.

Edit: screenshot

Edited by Edano

[color=rgb(255,0,0);][font="'comic sans ms', cursive;"]FukuLeaks[/color][/font]

Link to comment
Share on other sites

There might be a bug.

Local $nH,$nS,$nB,$nR=$t[0]/255,$nG=$t[1]/255,$nB=$t[2]/255,$nMax=$nR,$nMin=$nR

 $nB is declared and then initialized further down the line.  Should $nB be $nL?

Local $nH ,$nS, $nL, $nR = $t[0] / 255, $nG = $t[1] / 255, $nB = $t[2] / 255, $nMax = $nR, $nMin = $nR
Link to comment
Share on other sites

 

There might be a bug.

Local $nH,$nS,$nB,$nR=$t[0]/255,$nG=$t[1]/255,$nB=$t[2]/255,$nMax=$nR,$nMin=$nR

 $nB is declared and then initialized further down the line.  Should $nB be $nL?

Local $nH ,$nS, $nL, $nR = $t[0] / 255, $nG = $t[1] / 255, $nB = $t[2] / 255, $nMax = $nR, $nMin = $nR

 

yes, you maybe right. in fact, this function is not used in the script, i commented all the referring lines out. i left it there for future use ... or not :)

[color=rgb(255,0,0);][font="'comic sans ms', cursive;"]FukuLeaks[/color][/font]

Link to comment
Share on other sites

Have you considered making this into a UDF?

UDF List:

 
_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_ArrayFilter/_ArrayReduce_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 22/04/2018

Link to comment
Share on other sites

Have you considered making this into a UDF?

.

yes indeed. you found that in my comments ;) ?

i wrote it two years ago and i gave up the idea. you are so strict with your UDF requirements ....

 

Edit: something like _Color_GetShade ( $iBaseColor, $iDistance, $iMode=1, $iSaturation=-1, $iLuminance=-1 )

        or _Color_GetDistance ( $iColor1, $iColor2, $iMode=1 ) feel free to use it

Edited by Edano

[color=rgb(255,0,0);][font="'comic sans ms', cursive;"]FukuLeaks[/color][/font]

Link to comment
Share on other sites

.

you are so strict with your UDF requirements ....

Not me surely?! If you need advice or help then let me know what I can do.

UDF List:

 
_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_ArrayFilter/_ArrayReduce_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 22/04/2018

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...