jabhacksoul Posted August 10, 2014 Posted August 10, 2014 I have been busy elsewhere and today I dusted off AutoIt and decided to try something. This script will identify a color under the mouse and reply in human terms. I set the values to return on a scale of 0 to 10 and then using my best judgement I named the color. It could use some tweaks but it works. expandcollapse popupWhile 1 $pos = MouseGetPos() $ax = $pos[0] $ay = $pos[1] $var = PixelGetColor( $ax , $ay ) $color = Hex($var,6) $Redcv = Int(Dec(StringLeft ($color,2))/25.5) $Blucv = Int(Dec(StringRight ($color,2))/25.5) $Grncv = Int(Dec(StringMid ($color,3,2))/25.5) $cvalue = Get_Color ($Redcv,$Grncv,$Blucv) ToolTip ($cvalue) Sleep (50) WEnd Func Get_Color ($rv,$gv,$bv) $gc = "unknown" If $rv = $gv and $bv = $gv Then $gc = "Gray" If $rv > 8 and $gv > 8 and $bv > 8 Then $gc = "White" If $rv < 2 and $gv < 2 and $bv < 2 Then $gc = "Black" If $rv > $bv And $rv > $gv Then $gc = "Red" If $bv < 2 Then If $gv > 3 Then $gc = "Brown" If $gv > 5 Then $gc = "Orange" If $gv > 7 Then $gc = "Yellow" EndIf If $gv < 2 Then If $bv > 3 Then $gc = "Rust" If $bv > 5 Then $gc = "Pink" If $bv > 7 Then $gc = "Hot Pink" EndIf EndIf If $gv > $bv And $gv > $rv Then $gc = "Green" If $bv < 2 Then If $rv > 3 Then $gc = "Lt. Green" If $rv > 5 Then $gc = "Lime" If $rv > 7 Then $gc = "Yellow" EndIf If $rv < 2 Then If $bv > 3 Then $gc = "Lt. Green" If $bv > 5 Then $gc = "Turquoise" If $bv > 7 Then $gc = "Cyan" EndIf EndIf If $bv > $rv And $bv > $gv Then $gc = "Blue" If $rv < 2 Then If $gv > 3 Then $gc = "Sea Blue" If $gv > 5 Then $gc = "Sky Blue" If $gv > 7 Then $gc = "Cyan" EndIf If $gv < 2 Then If $rv > 3 Then $gc = "Violet" If $rv > 5 Then $gc = "Purple" If $rv > 7 Then $gc = "Hot Pink" EndIf EndIf Return $gc EndFunc Please note: The last time I posted here was over 2 years ago because some moron got me ticked off. I write programs and scripts for a living and I am not some child sitting in mom's dungeon hacking interweb games. All I ask for is a little respect and I will return the same. Have a better one.
Moderators Melba23 Posted August 10, 2014 Moderators Posted August 10, 2014 jabhacksoul,I see you hold a grudge really well - I hope it did not keep you awake at night! From this thread:All I ask for is a little respectAnd from your last thread:The people on this forum are freaking brain deadDo you not think that you could have started your new tenure here in a better way by acting in the very manner you demand from us rather than being as aggressive as you were? Anyway, with an attitude like that I wonder how long you will last this time around..... M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area
Developers Jos Posted August 10, 2014 Developers Posted August 10, 2014 Please note: The last time I posted here was over 2 years ago because some moron got me ticked off. I write programs and scripts for a living and I am not some child sitting in mom's dungeon hacking interweb games. All I ask for is a little respect and I will return the same. Have a better one. Welcome back for the 3rd time. Funny to see your still haven't lost the attitude you first shown when you were here as Kahn... Enjoy your stay here, Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now