ValeryVal Posted March 31, 2010 Share Posted March 31, 2010 This example can create tartan image. See about tartan here Current version knows following colors: Yellow, Blue, Gray, Red, Green, WhiteShort names: Y, B, D, R, G, WBe careful! Short name for Gray is D (dark).ATartan.au3:expandcollapse popup;=================================================== ; ATartan by Valery Ivanov, 30 March 2010 ;=================================================== #include <Color.au3> #include <GuiConstantsEx.au3> #include <GDIPlus.au3> #include <WinAPI.au3> #include <ScreenCapture.au3> Opt('MustDeclareVars', 1) Global $Caption = "ATartan © Valery Ivanov, 30 March 2010" Global $YellowFront = 0xFFECDC00, $YellowBack = 0xFFD4B300 Global $BlueFront = 0xFF3C9CE0, $BlueBack = 0xFF08419C Global $RedFront = 0xFFE03C9C, $RedBack = 0xFF9C0841 Global $GreenFront = 0xFF3CE09C, $GreenBack = 0xFF089C41 Global $GrayFront = 0xFFC8C8C8, $GrayBack = 0xFF8E8E8E Global $WhiteFront = 0xF0EEEEE, $WhiteBack = 0xF0AFAFAF Global $FrontColor_Yellow = $YellowFront, $BackColor_Yellow = $YellowBack Global $FrontColor_Blue = $BlueFront, $BackColor_Blue = $BlueBack Global $FrontColor_Gray = $GrayFront, $BackColor_Gray = $GrayBack Global $FrontColor_Red = $RedFront, $BackColor_Red = $RedBack Global $FrontColor_Green = $GreenFront, $BackColor_Green = $GreenBack Global $FrontColor_White = $WhiteFront, $BackColor_White = $WhiteBack Global $hBrushFront_Yellow, $hBrushBack_Yellow Global $hBrushFront_Blue, $hBrushBack_Blue Global $hBrushFront_Gray, $hBrushBack_Gray Global $hBrushFront_Red, $hBrushBack_Red Global $hBrushFront_Green, $hBrushBack_Green Global $hBrushFront_White, $hBrushBack_White Global $hBrushFront, $hBrushBack ;Tartan description Global $ColorFullNames = StringSplit("Yellow,Blue,Gray,Red,Green,White",",") Global $ColorShortNames = StringSplit("Y,B,D,R,G,W",",") ;Global $TartanShortCode = "D4,B12,D4,R12,W4,R12,D4,B12,D4,G12,D4,Y12,W4,Y12,D4,G12" Global $TartanShortCode = "R12,D4,B12,D4,G12,D4,Y12,W4,Y12,D4,G12" Global $TartanShortSet = StringSplit($TartanShortCode,",") ;Middle strip is skipped Global $Tartan_count = 2*$TartanShortSet[0]-1 Global $Zoom = 0.5, $Size = Round(90/$Zoom) Global $iX, $iY Global $nHeight = Round(50/$Zoom), $nWidth = Round(50/$Zoom) Global $FileSaved = @ScriptDir & "\Tartan.jpg" Global $hGUI, $hGraphic, $hDC, $hImage, $hBitmap, $Msg Global $RedrawButton, $ZoomButton, $SaveButton, $Pic, $hPic Global $CodeLabel, $CreateButton ; Create GUI $hGUI = GUICreate($Caption, 900, 800) GUICtrlCreateGroup("Actions:", 10, 10, 170, 780) GUICtrlSetFont(-1, 10, 800, 0, "Verdana") $RedrawButton = GUICtrlCreateButton("Recreate", 40, 40, 110, 20) GUICtrlSetFont(-1, 10, 800, 0, "Verdana") $SaveButton = GUICtrlCreateButton("Save", 40, 70, 110, 20) GUICtrlSetFont(-1, 10, 800, 0, "Verdana") $ZoomButton = GUICtrlCreateButton("Zoom", 40, 100, 110, 20) GUICtrlSetFont(-1, 10, 800, 0, "Verdana") GUICtrlCreateGroup("Code:", 185, 10, 710, 55) GUICtrlSetFont(-1, 10, 800, 0, "Verdana") $CodeLabel = GUICtrlCreateInput($TartanShortCode, 200, 40, 500, 20) GUICtrlSetFont(-1, 10, 800, 0, "Verdana") $CreateButton = GUICtrlCreateButton("Create", 720, 40, 110, 20) GUICtrlSetFont(-1, 10, 800, 0, "Verdana") GUICtrlCreateGroup("Tartan:", 185, 75, 710, 720) GUICtrlSetFont(-1, 10, 800, 0, "Verdana") If FileExists($FileSaved) then $Pic = GUICtrlCreatePic(@ScriptDir & "\Tartan.jpg", 190, 90, 700, 700) else $Pic = GUICtrlCreatePic("", 190, 90, 700, 700) endif GUISetState() $hPic = GUICtrlGetHandle ($Pic) _GDIPlus_Startup () $hGraphic = _GDIPlus_GraphicsCreateFromHWND ($hPic) ;_GDIPlus_GraphicsSetSmoothingMode($hGraphic, 1) CreateBrushes() TartanParse($TartanShortCode) DrawPlaid($hGraphic) While 1 $Msg = GUIGetMsg() switch $Msg case $GUI_EVENT_CLOSE ExitLoop case $CreateButton TartanParse(GUICtrlRead($CodeLabel)) DrawPlaid($hGraphic) case $RedrawButton DrawPlaid($hGraphic) case $SaveButton Save() case $ZoomButton $Zoom /= 2 if $Zoom < 0.25 then $Zoom = 2 DrawPlaid($hGraphic) endswitch WEnd ; Clean up resources _GDIPlus_GraphicsDispose ($hGraphic) DisposeBrushes() _WinAPI_ReleaseDC($hGUI, $hDC) _GDIPlus_Shutdown () exit ;===================================== ; Save Image func Save() _ScreenCapture_CaptureWnd (@ScriptDir & "\Tartan.jpg", $hPic) endfunc ;===================================== ; Create Brushes func CreateBrushes() $hBrushFront_Yellow = _GDIPlus_BrushCreateSolid ($FrontColor_Yellow) $hBrushBack_Yellow = _GDIPlus_BrushCreateSolid ($BackColor_Yellow) $hBrushFront_Blue = _GDIPlus_BrushCreateSolid ($FrontColor_Blue) $hBrushBack_Blue = _GDIPlus_BrushCreateSolid ($BackColor_Blue) $hBrushFront_Gray = _GDIPlus_BrushCreateSolid ($FrontColor_Gray) $hBrushBack_Gray = _GDIPlus_BrushCreateSolid ($BackColor_Gray) $hBrushFront_Red = _GDIPlus_BrushCreateSolid ($FrontColor_Red) $hBrushBack_Red = _GDIPlus_BrushCreateSolid ($BackColor_Red) $hBrushFront_Green = _GDIPlus_BrushCreateSolid ($FrontColor_Green) $hBrushBack_Green = _GDIPlus_BrushCreateSolid ($BackColor_Green) $hBrushFront_White = _GDIPlus_BrushCreateSolid ($FrontColor_White) $hBrushBack_White = _GDIPlus_BrushCreateSolid ($BackColor_White) endfunc ;===================================== ; Dispose Brushes func DisposeBrushes() _GDIPlus_BrushDispose ($hBrushFront_Yellow) _GDIPlus_BrushDispose ($hBrushBack_Yellow) _GDIPlus_BrushDispose ($hBrushFront_Blue) _GDIPlus_BrushDispose ($hBrushBack_Blue) _GDIPlus_BrushDispose ($hBrushFront_Gray) _GDIPlus_BrushDispose ($hBrushBack_Gray) _GDIPlus_BrushDispose ($hBrushFront_Red) _GDIPlus_BrushDispose ($hBrushBack_Red) _GDIPlus_BrushDispose ($hBrushFront_Green) _GDIPlus_BrushDispose ($hBrushBack_Green) _GDIPlus_BrushDispose ($hBrushFront_White) _GDIPlus_BrushDispose ($hBrushBack_White) endfunc ;===================================== ; Draw Plaid func DrawPlaid($hG) local $PosMax, $NStrip = 1, $CurColor _GDIPlus_GraphicsClear ($hG,0xFFFFFFFF) $Size = Round(90/$Zoom) $nHeight = Round(50/$Zoom) $nWidth = Round(50/$Zoom) $PosMax = $Tartan_Width_1 - 1 $CurColor = $Tartan_Color_1 $hBrushFront = Eval("hBrushFront_" & $CurColor) $hBrushBack = Eval("hBrushBack_" & $CurColor) for $i = 0 to $Size if $i > $PosMax then $NStrip += 1 if $NStrip > $Tartan_count then $hBrushFront = $hBrushFront_White $hBrushBack = $hBrushBack_White else $PosMax += Eval("Tartan_Width_" & $NStrip) $CurColor = Eval("Tartan_Color_" & $NStrip) $hBrushFront = Eval("hBrushFront_" & $CurColor) $hBrushBack = Eval("hBrushBack_" & $CurColor) endif endif Create_Ver_Thread($hG,$i) Create_Hor_Thread($hG,$i) next endfunc ;===================================== ; Draw Vertical Thread func Create_Ver_Thread($hG,$nCol) local $iX, $iYStart, $i $iX = +8*$Zoom*($nCol-1) $iYStart = -8*$Zoom*($nCol-1) for $i = -$nHeight to $nHeight $iY = $iYStart+32*$Zoom*$i if $iX >= -9*$Zoom and $iY >= -13*$Zoom then Create_VCell($hG,$iX,$iY) next endfunc ;===================================== ; Draw Horizontal Thread func Create_Hor_Thread($hG,$nRow) local $iY, $iXStart, $i $iXStart = -8*$Zoom*($nRow-1) $iY = +8*$Zoom*($nRow-1) for $i = -$nWidth to $nWidth $iX = $iXStart+32*$Zoom*$i if $iX >= -25*$Zoom and $iY >= -9*$Zoom then Create_HCell($hG,$iX,$iY) next endfunc ;===================================== ; Draw Vertical Cell func Create_VCell($hG,$iX,$iY) ; Front_V _GDIPlus_GraphicsFillRect($hG, $iX,$iY, 4*$Zoom, 12*$Zoom, $hBrushFront) _GDIPlus_GraphicsFillRect($hG, $iX+4*$Zoom,$iY, 4*$Zoom, 12*$Zoom, $hBrushBack) endfunc ;===================================== ; Draw Horizontal Cell func Create_HCell($hG,$iX,$iY) $iY += 8*$Zoom _GDIPlus_GraphicsFillRect($hG, $iX+12*$Zoom,$iY, 12*$Zoom, 4*$Zoom, $hBrushFront) _GDIPlus_GraphicsFillRect($hG, $iX+8*$Zoom,$iY, 4*$Zoom, 4*$Zoom, $hBrushBack) _GDIPlus_GraphicsFillRect($hG, $iX,$iY+4*$Zoom, 24*$Zoom, 4*$Zoom, $hBrushBack) endfunc ;===================================== ; Parse Tartan Code func TartanParse($TCode) local $Color, $Width local $TSet = StringSplit($TCode,",") $Tartan_count = 2*$TSet[0]-1 For $i = 1 To $TSet[0]-1 $Color = ColorName(StringLeft($TSet[$i],1)) $Width = StringTrimLeft($TSet[$i],1) Assign("Tartan_Color_" & $i,$Color,2) Assign("Tartan_Width_" & $i,$Width,2) Assign("Tartan_Color_" & $Tartan_count+1-$i,$Color,2) Assign("Tartan_Width_" & $Tartan_count+1-$i,$Width,2) next $Color = ColorName(StringLeft($TSet[$TSet[0]],1)) $Width = StringTrimLeft($TSet[$TSet[0]],1) Assign("Tartan_Color_" & $TSet[0],$Color,2) Assign("Tartan_Width_" & $TSet[0],$Width,2) endfunc ;===================================== ; Get full name of color by it's short name func ColorName($ColorShortName) local $DefaultColorName = "White" For $i = 1 To $ColorFullNames[0] if $ColorShortName = $ColorShortNames[$i] then return $ColorFullNames[$i] next return $DefaultColorName endfuncEnjoy The point of world view Link to comment Share on other sites More sharing options...
James Posted March 31, 2010 Share Posted March 31, 2010 Heh, I know BigDod will like this - Scottish fellow and all. I like it a lot 5 stars just for creativity. James Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ Link to comment Share on other sites More sharing options...
ValeryVal Posted April 1, 2010 Author Share Posted April 1, 2010 This version has more short source and new options: - Parts of tartan code can be delimited by space " " (or "," ) - New color ("K" means Black) So you can create tartan from wiki as is "K4 R24 K24 Y4" ATartan.au3: expandcollapse popup;=================================================== ; ATartan by Valery Ivanov, 30 March 2010 ;=================================================== ; History ; 1 April: ; - Parts of tartan code can be delimited by space " " (or "," ) ; - More short source ; - New color ("K" means Black) ; #include <Color.au3> #include <GuiConstantsEx.au3> #include <GDIPlus.au3> #include <ScreenCapture.au3> Opt('MustDeclareVars', 1) Global $Caption = "ATartan © Valery Ivanov, 30 March 2010" Global $YellowFront = 0xFFECDC00, $YellowBack = 0xFFD4B300 Global $BlueFront = 0xFF3C9CE0, $BlueBack = 0xFF08419C Global $RedFront = 0xFFE03C9C, $RedBack = 0xFF9C0841 Global $GreenFront = 0xFF3CE09C, $GreenBack = 0xFF089C41 Global $GrayFront = 0xFFC8C8C8, $GrayBack = 0xFF8E8E8E Global $WhiteFront = 0xF0EEEEE, $WhiteBack = 0xF0AFAFAF Global $BlackFront = 0xF0404040, $BlackBack = 0xF0000000 Global $FrontColor_Yellow = $YellowFront, $BackColor_Yellow = $YellowBack Global $FrontColor_Blue = $BlueFront, $BackColor_Blue = $BlueBack Global $FrontColor_Gray = $GrayFront, $BackColor_Gray = $GrayBack Global $FrontColor_Red = $RedFront, $BackColor_Red = $RedBack Global $FrontColor_Green = $GreenFront, $BackColor_Green = $GreenBack Global $FrontColor_White = $WhiteFront, $BackColor_White = $WhiteBack Global $FrontColor_Black = $BlackFront, $BackColor_Black = $BlackBack Global $hBrushFront, $hBrushBack ;Tartan description Global $ColorFullNames = StringSplit("Yellow,Blue,Gray,Red,Green,White,Black",",") Global $ColorShortNames = StringSplit("Y,B,D,R,G,W,K",",") ;Global $TartanShortCode = "D4,B12,D4,R12,W4,R12,D4,B12,D4,G12,D4,Y12,W4,Y12,D4,G12" ;Global $TartanShortCode = "R12,D4,B12,D4,G12,D4,Y12,W4,Y12,D4,G12" Global $TartanShortCode = "R12 D4 B12 D4 G12 D4 Y12 W4 Y12 D4 G12" Global $TartanShortSet = StringSplit($TartanShortCode,",") ;Middle strip is skipped Global $Tartan_count = 2*$TartanShortSet[0]-1 Global $Zoom = 0.5, $Size = Round(90/$Zoom) Global $iX, $iY Global $nHeight = Round(50/$Zoom), $nWidth = Round(50/$Zoom) Global $FileSaved = @ScriptDir & "\Tartan.jpg" Global $hGUI, $hGraphic, $hImage, $hBitmap, $Msg Global $RedrawButton, $ZoomButton, $SaveButton, $Pic, $hPic Global $CodeLabel, $CreateButton ; Create GUI $hGUI = GUICreate($Caption, 900, 800) GUICtrlCreateGroup("Actions:", 10, 10, 170, 780) GUICtrlSetFont(-1, 10, 800, 0, "Verdana") $RedrawButton = GUICtrlCreateButton("Recreate", 40, 40, 110, 20) GUICtrlSetFont(-1, 10, 800, 0, "Verdana") $SaveButton = GUICtrlCreateButton("Save", 40, 70, 110, 20) GUICtrlSetFont(-1, 10, 800, 0, "Verdana") $ZoomButton = GUICtrlCreateButton("Zoom", 40, 100, 110, 20) GUICtrlSetFont(-1, 10, 800, 0, "Verdana") GUICtrlCreateGroup("Code:", 185, 10, 710, 55) GUICtrlSetFont(-1, 10, 800, 0, "Verdana") $CodeLabel = GUICtrlCreateInput($TartanShortCode, 200, 40, 500, 20) GUICtrlSetFont(-1, 10, 800, 0, "Verdana") $CreateButton = GUICtrlCreateButton("Create", 720, 40, 110, 20) GUICtrlSetFont(-1, 10, 800, 0, "Verdana") GUICtrlCreateGroup("Tartan:", 185, 75, 710, 720) GUICtrlSetFont(-1, 10, 800, 0, "Verdana") If FileExists($FileSaved) then $Pic = GUICtrlCreatePic(@ScriptDir & "\Tartan.jpg", 190, 90, 700, 700) else $Pic = GUICtrlCreatePic("", 190, 90, 700, 700) endif GUISetState() $hPic = GUICtrlGetHandle ($Pic) _GDIPlus_Startup () $hGraphic = _GDIPlus_GraphicsCreateFromHWND ($hPic) ;_GDIPlus_GraphicsSetSmoothingMode($hGraphic, 1) CreateBrushes() TartanParse($TartanShortCode) DrawPlaid($hGraphic) While 1 $Msg = GUIGetMsg() switch $Msg case $GUI_EVENT_CLOSE ExitLoop case $CreateButton TartanParse(GUICtrlRead($CodeLabel)) DrawPlaid($hGraphic) case $RedrawButton DrawPlaid($hGraphic) case $SaveButton Save() case $ZoomButton $Zoom /= 2 if $Zoom < 0.25 then $Zoom = 2 DrawPlaid($hGraphic) endswitch WEnd ; Clean up resources _GDIPlus_GraphicsDispose ($hGraphic) DisposeBrushes() _GDIPlus_Shutdown () exit ;===================================== ; Save Image func Save() _ScreenCapture_CaptureWnd (@ScriptDir & "\Tartan.jpg", $hPic) endfunc ;===================================== ; Create Brushes func CreateBrushes() local $Col for $i = 1 to $ColorFullNames[0] $Col = $ColorFullNames[$i] Assign("hBrushFront_" & $Col,_GDIPlus_BrushCreateSolid (Eval("FrontColor_" & $Col)),2) Assign("hBrushBack_" & $Col,_GDIPlus_BrushCreateSolid (Eval("BackColor_" & $Col)),2) next endfunc ;===================================== ; Dispose Brushes func DisposeBrushes() local $Col for $i = 1 to $ColorFullNames[0] $Col = $ColorFullNames[$i] _GDIPlus_BrushDispose (Eval("hBrushFront_" & $Col)) _GDIPlus_BrushDispose (Eval("hBrushBack_" & $Col)) next endfunc ;===================================== ; Draw Plaid func DrawPlaid($hG) local $PosMax, $NStrip = 1, $CurColor _GDIPlus_GraphicsClear ($hG,0xFFFFFFFF) $Size = Round(90/$Zoom) $nHeight = Round(50/$Zoom) $nWidth = Round(50/$Zoom) $PosMax = $Tartan_Width_1 - 1 $CurColor = $Tartan_Color_1 $hBrushFront = Eval("hBrushFront_" & $CurColor) $hBrushBack = Eval("hBrushBack_" & $CurColor) for $i = 0 to $Size if $i > $PosMax then $NStrip += 1 if $NStrip > $Tartan_count then $hBrushFront = $hBrushFront_White $hBrushBack = $hBrushBack_White else $PosMax += Eval("Tartan_Width_" & $NStrip) $CurColor = Eval("Tartan_Color_" & $NStrip) $hBrushFront = Eval("hBrushFront_" & $CurColor) $hBrushBack = Eval("hBrushBack_" & $CurColor) endif endif Create_Ver_Thread($hG,$i) Create_Hor_Thread($hG,$i) next endfunc ;===================================== ; Draw Vertical Thread func Create_Ver_Thread($hG,$nCol) local $iX, $iYStart, $i $iX = +8*$Zoom*($nCol-1) $iYStart = -8*$Zoom*($nCol-1) for $i = -$nHeight to $nHeight $iY = $iYStart+32*$Zoom*$i if $iX >= -9*$Zoom and $iY >= -13*$Zoom then Create_VCell($hG,$iX,$iY) next endfunc ;===================================== ; Draw Horizontal Thread func Create_Hor_Thread($hG,$nRow) local $iY, $iXStart, $i $iXStart = -8*$Zoom*($nRow-1) $iY = +8*$Zoom*($nRow-1) for $i = -$nWidth to $nWidth $iX = $iXStart+32*$Zoom*$i if $iX >= -25*$Zoom and $iY >= -9*$Zoom then Create_HCell($hG,$iX,$iY) next endfunc ;===================================== ; Draw Vertical Cell func Create_VCell($hG,$iX,$iY) ; Front_V _GDIPlus_GraphicsFillRect($hG, $iX,$iY, 4*$Zoom, 12*$Zoom, $hBrushFront) _GDIPlus_GraphicsFillRect($hG, $iX+4*$Zoom,$iY, 4*$Zoom, 12*$Zoom, $hBrushBack) endfunc ;===================================== ; Draw Horizontal Cell func Create_HCell($hG,$iX,$iY) $iY += 8*$Zoom _GDIPlus_GraphicsFillRect($hG, $iX+12*$Zoom,$iY, 12*$Zoom, 4*$Zoom, $hBrushFront) _GDIPlus_GraphicsFillRect($hG, $iX+8*$Zoom,$iY, 4*$Zoom, 4*$Zoom, $hBrushBack) _GDIPlus_GraphicsFillRect($hG, $iX,$iY+4*$Zoom, 24*$Zoom, 4*$Zoom, $hBrushBack) endfunc ;===================================== ; Parse Tartan Code func TartanParse($TCode) local $Color, $Width local $TSet = StringSplit($TCode,", ") $Tartan_count = 2*$TSet[0]-1 For $i = 1 To $TSet[0]-1 $Color = ColorName(StringLeft($TSet[$i],1)) $Width = StringTrimLeft($TSet[$i],1) Assign("Tartan_Color_" & $i,$Color,2) Assign("Tartan_Width_" & $i,$Width,2) Assign("Tartan_Color_" & $Tartan_count+1-$i,$Color,2) Assign("Tartan_Width_" & $Tartan_count+1-$i,$Width,2) next $Color = ColorName(StringLeft($TSet[$TSet[0]],1)) $Width = StringTrimLeft($TSet[$TSet[0]],1) Assign("Tartan_Color_" & $TSet[0],$Color,2) Assign("Tartan_Width_" & $TSet[0],$Width,2) endfunc ;===================================== ; Get full name of color by it's short name func ColorName($ColorShortName) local $DefaultColorName = "White" For $i = 1 To $ColorFullNames[0] if $ColorShortName = $ColorShortNames[$i] then return $ColorFullNames[$i] next return $DefaultColorName endfunc Enjoy, The point of world view Link to comment Share on other sites More sharing options...
ValeryVal Posted April 1, 2010 Author Share Posted April 1, 2010 Wiki has page with famous tartan codes. Vestiarium_ScoticumFor easy recreation these ones ATartan knows about Gy as Gray (used to D) and Bk as Black (used to K)ATartan.au3expandcollapse popup;=================================================== ; ATartan by Valery Ivanov, 30 March 2010 ;=================================================== ; History ; 1 April: ; - Parts of tartan code can be delimited by space " " (or "," ) ; - More short source ; - New color ("K" means Black) ; - Tartan can use Gy as Gray (used to D) and Bk as Black (used to K) ; - Strip double (or more) spaces between words, leading and trailing white spaces! #include <Color.au3> #include <GuiConstantsEx.au3> #include <GDIPlus.au3> #include <ScreenCapture.au3> Opt('MustDeclareVars', 1) Global $Caption = "ATartan © Valery Ivanov, 30 March 2010" Global $YellowFront = 0xFFECDC00, $YellowBack = 0xFFD4B300 Global $BlueFront = 0xFF3C9CE0, $BlueBack = 0xFF08419C Global $RedFront = 0xFFE03C9C, $RedBack = 0xFF9C0841 Global $GreenFront = 0xFF3CE09C, $GreenBack = 0xFF089C41 Global $GrayFront = 0xFFC8C8C8, $GrayBack = 0xFF8E8E8E Global $WhiteFront = 0xF0EEEEE, $WhiteBack = 0xF0AFAFAF Global $BlackFront = 0xF0404040, $BlackBack = 0xF0000000 Global $FrontColor_Yellow = $YellowFront, $BackColor_Yellow = $YellowBack Global $FrontColor_Blue = $BlueFront, $BackColor_Blue = $BlueBack Global $FrontColor_Gray = $GrayFront, $BackColor_Gray = $GrayBack Global $FrontColor_Red = $RedFront, $BackColor_Red = $RedBack Global $FrontColor_Green = $GreenFront, $BackColor_Green = $GreenBack Global $FrontColor_White = $WhiteFront, $BackColor_White = $WhiteBack Global $FrontColor_Black = $BlackFront, $BackColor_Black = $BlackBack Global $hBrushFront, $hBrushBack ;Tartan description Global $ColorFullNames = StringSplit("Yellow,Blue,Gray,Red,Green,White,Black",",") Global $ColorShortNames = StringSplit("Y,B,D,R,G,W,K",",") ;Global $TartanShortCode = "D4,B12,D4,R12,W4,R12,D4,B12,D4,G12,D4,Y12,W4,Y12,D4,G12" ;Global $TartanShortCode = "R12,D4,B12,D4,G12,D4,Y12,W4,Y12,D4,G12" Global $TartanShortCode = "R12 D4 B12 D4 G12 D4 Y12 W4 Y12 D4 G12" Global $TartanShortSet = StringSplit($TartanShortCode,",") ;Middle strip is skipped Global $Tartan_count = 2*$TartanShortSet[0]-1 Global $Zoom = 0.5, $Size = Round(90/$Zoom) Global $iX, $iY Global $nHeight = Round(50/$Zoom), $nWidth = Round(50/$Zoom) Global $FileSaved = @ScriptDir & "\Tartan.jpg" Global $hGUI, $hGraphic, $hImage, $hBitmap, $Msg Global $RedrawButton, $ZoomButton, $SaveButton, $Pic, $hPic Global $CodeLabel, $CreateButton ; Create GUI $hGUI = GUICreate($Caption, 900, 800) GUICtrlCreateGroup("Actions:", 10, 10, 170, 780) GUICtrlSetFont(-1, 10, 800, 0, "Verdana") $RedrawButton = GUICtrlCreateButton("Recreate", 40, 40, 110, 20) GUICtrlSetFont(-1, 10, 800, 0, "Verdana") $SaveButton = GUICtrlCreateButton("Save", 40, 70, 110, 20) GUICtrlSetFont(-1, 10, 800, 0, "Verdana") $ZoomButton = GUICtrlCreateButton("Zoom", 40, 100, 110, 20) GUICtrlSetFont(-1, 10, 800, 0, "Verdana") GUICtrlCreateGroup("Code:", 185, 10, 710, 55) GUICtrlSetFont(-1, 10, 800, 0, "Verdana") $CodeLabel = GUICtrlCreateInput($TartanShortCode, 200, 40, 500, 20) GUICtrlSetFont(-1, 10, 800, 0, "Verdana") $CreateButton = GUICtrlCreateButton("Create", 720, 40, 110, 20) GUICtrlSetFont(-1, 10, 800, 0, "Verdana") GUICtrlCreateGroup("Tartan:", 185, 75, 710, 720) GUICtrlSetFont(-1, 10, 800, 0, "Verdana") If FileExists($FileSaved) then $Pic = GUICtrlCreatePic(@ScriptDir & "\Tartan.jpg", 190, 90, 700, 700) else $Pic = GUICtrlCreatePic("", 190, 90, 700, 700) endif GUISetState() $hPic = GUICtrlGetHandle ($Pic) _GDIPlus_Startup () $hGraphic = _GDIPlus_GraphicsCreateFromHWND ($hPic) ;_GDIPlus_GraphicsSetSmoothingMode($hGraphic, 1) CreateBrushes() TartanParse($TartanShortCode) DrawPlaid($hGraphic) While 1 $Msg = GUIGetMsg() switch $Msg case $GUI_EVENT_CLOSE ExitLoop case $CreateButton $TartanShortCode = StringStripWS(GUICtrlRead($CodeLabel),7) $TartanShortCode = StringReplace($TartanShortCode,"Bk", "K") $TartanShortCode = StringReplace($TartanShortCode,"Gy", "D") TartanParse($TartanShortCode) DrawPlaid($hGraphic) case $RedrawButton DrawPlaid($hGraphic) case $SaveButton Save() case $ZoomButton $Zoom /= 2 if $Zoom < 0.25 then $Zoom = 2 DrawPlaid($hGraphic) endswitch WEnd ; Clean up resources _GDIPlus_GraphicsDispose ($hGraphic) DisposeBrushes() _GDIPlus_Shutdown () exit ;===================================== ; Save Image func Save() _ScreenCapture_CaptureWnd (@ScriptDir & "\Tartan.jpg", $hPic) endfunc ;===================================== ; Create Brushes func CreateBrushes() local $Col for $i = 1 to $ColorFullNames[0] $Col = $ColorFullNames[$i] Assign("hBrushFront_" & $Col,_GDIPlus_BrushCreateSolid (Eval("FrontColor_" & $Col)),2) Assign("hBrushBack_" & $Col,_GDIPlus_BrushCreateSolid (Eval("BackColor_" & $Col)),2) next endfunc ;===================================== ; Dispose Brushes func DisposeBrushes() local $Col for $i = 1 to $ColorFullNames[0] $Col = $ColorFullNames[$i] _GDIPlus_BrushDispose (Eval("hBrushFront_" & $Col)) _GDIPlus_BrushDispose (Eval("hBrushBack_" & $Col)) next endfunc ;===================================== ; Draw Plaid func DrawPlaid($hG) local $PosMax, $NStrip = 1, $CurColor _GDIPlus_GraphicsClear ($hG,0xFFFFFFFF) $Size = Round(90/$Zoom) $nHeight = Round(50/$Zoom) $nWidth = Round(50/$Zoom) $PosMax = $Tartan_Width_1 - 1 $CurColor = $Tartan_Color_1 $hBrushFront = Eval("hBrushFront_" & $CurColor) $hBrushBack = Eval("hBrushBack_" & $CurColor) for $i = 0 to $Size if $i > $PosMax then $NStrip += 1 if $NStrip > $Tartan_count then $hBrushFront = $hBrushFront_White $hBrushBack = $hBrushBack_White else $PosMax += Eval("Tartan_Width_" & $NStrip) $CurColor = Eval("Tartan_Color_" & $NStrip) $hBrushFront = Eval("hBrushFront_" & $CurColor) $hBrushBack = Eval("hBrushBack_" & $CurColor) endif endif Create_Ver_Thread($hG,$i) Create_Hor_Thread($hG,$i) next endfunc ;===================================== ; Draw Vertical Thread func Create_Ver_Thread($hG,$nCol) local $iX, $iYStart, $i $iX = +8*$Zoom*($nCol-1) $iYStart = -8*$Zoom*($nCol-1) for $i = -$nHeight to $nHeight $iY = $iYStart+32*$Zoom*$i if $iX >= -9*$Zoom and $iY >= -13*$Zoom then Create_VCell($hG,$iX,$iY) next endfunc ;===================================== ; Draw Horizontal Thread func Create_Hor_Thread($hG,$nRow) local $iY, $iXStart, $i $iXStart = -8*$Zoom*($nRow-1) $iY = +8*$Zoom*($nRow-1) for $i = -$nWidth to $nWidth $iX = $iXStart+32*$Zoom*$i if $iX >= -25*$Zoom and $iY >= -9*$Zoom then Create_HCell($hG,$iX,$iY) next endfunc ;===================================== ; Draw Vertical Cell func Create_VCell($hG,$iX,$iY) ; Front_V _GDIPlus_GraphicsFillRect($hG, $iX,$iY, 4*$Zoom, 12*$Zoom, $hBrushFront) _GDIPlus_GraphicsFillRect($hG, $iX+4*$Zoom,$iY, 4*$Zoom, 12*$Zoom, $hBrushBack) endfunc ;===================================== ; Draw Horizontal Cell func Create_HCell($hG,$iX,$iY) $iY += 8*$Zoom _GDIPlus_GraphicsFillRect($hG, $iX+12*$Zoom,$iY, 12*$Zoom, 4*$Zoom, $hBrushFront) _GDIPlus_GraphicsFillRect($hG, $iX+8*$Zoom,$iY, 4*$Zoom, 4*$Zoom, $hBrushBack) _GDIPlus_GraphicsFillRect($hG, $iX,$iY+4*$Zoom, 24*$Zoom, 4*$Zoom, $hBrushBack) endfunc ;===================================== ; Parse Tartan Code func TartanParse($TCode) local $Color, $Width local $TSet = StringSplit($TCode,", ") $Tartan_count = 2*$TSet[0]-1 For $i = 1 To $TSet[0]-1 $Color = ColorName(StringLeft($TSet[$i],1)) $Width = StringTrimLeft($TSet[$i],1) Assign("Tartan_Color_" & $i,$Color,2) Assign("Tartan_Width_" & $i,$Width,2) Assign("Tartan_Color_" & $Tartan_count+1-$i,$Color,2) Assign("Tartan_Width_" & $Tartan_count+1-$i,$Width,2) next $Color = ColorName(StringLeft($TSet[$TSet[0]],1)) $Width = StringTrimLeft($TSet[$TSet[0]],1) Assign("Tartan_Color_" & $TSet[0],$Color,2) Assign("Tartan_Width_" & $TSet[0],$Width,2) endfunc ;===================================== ; Get full name of color by it's short name func ColorName($ColorShortName) local $DefaultColorName = "White" For $i = 1 To $ColorFullNames[0] if $ColorShortName = $ColorShortNames[$i] then return $ColorFullNames[$i] next return $DefaultColorName endfuncBTW Examples from link above:expandcollapse popup1 The Clan Stewart G4 R60 B8 R8 Bk12 Y2 Bk2 W2 Bk2 G20 R8 Bk2 R2 W2 2 Prince of Rothsay W4 R64 G4 R6 G4 R8 G32 R8 G32 R8 G4 R6 G4 R64 W2 R2 W4 3 ye principal clovris of ye clanne Stewart R6 W56 Bk6 W6 Bk6 W6 g26 R16 Bk2 R2 W2 4 MakDonnald of ye Ylis R6 B20 Bk24 G6 Bk2 G2 Bk2 G60 W8 5 clan Raynald B10 R4 B30 R4 Bk16 G52 R6 G2 R4 G6 W6 6 Clann Gregour R128 G36 R10 G16 W4 8 Clan Makduffe R6 G32 B12 Bk12 R48 Bk4 R8 9 Makanphersonis W6 R2 W60 Bk30 W6 Bk18 Y2 10 Clann Grant, or clann Grauntacke R8 B4 R4 b4 R112 B32 R8 G2 R8 G72 R6 G2 R8 11 Monrois Bk36 R8 Bk36 R64 W6 12 Clann-Lewid Bk16 Y2 Bk16 Y24 R2 13 Clan Campbell B132 Bk2 B2 Bk2 B6 Bk24 G52 W/Y6 G52 Bk24 B42 Bk2 B8 14 Svtherlande G12 W4 G48 Bk24 B6 Bk4 B4 Bk4 B24 R2 B2R6 15 Clanchamron R8 G24 R8 G24 R64 Y4 16 Clanneil B12 R2 B40 G12 B12 G48 Bk2 G4 W8 17 Mackfarlan Bk54 W48 Bk8W48 18 Clanlavchlan Bk12 Y4 Bk42 Y4 Bk12 Y48 Bk4 Y12 19 Clan-gillean G12 Bk20 W4 Bk20 G6 Bk8 G60 Bk4 20 Clankenjie B56 Bk6 B6 Bk6 B6 Bk20 G54 W/R6 G54 Bk20 B56 Bk2 B12 21 Fryjjelis in ye Ayrd R4 B12 R4 G12 R24 W4 22 Menghes W4 R40 Cr2 R2 Cr2 R6 Cr10 W48 R6 W4 R2 W8 23 Chyssal R2 G28 Bk2 G4 Bk2 G4 B14 R56 W2 R12 24 Buchananis Bk2 W18 Cr8 W4 Cr8 W4 25 Clan Lawmond B50 Bk2 B2 Bk2 B4 Bk28 G60 W8 G60 Bk28 B32 Bk2 B6 26 Clann Dowgall of Lorne R8 G18 Bk12 Cr16 R10 G4 R4 G4 R52 G2 R6 27 Makyntryris G10 B26 R6 B26 G64 W10 28 Clandonoquhay G2 R68 B16 R4 G40 R4 29 Maknabbis G14 R4 Cr4 G8 Cr4 R24 Bk2 30 Clannkynnon Bk2 R36 G24 R4 G24 R36 W2 31 Makyntosche R6 G32 Bk24 R56 W4 R10 32 Clanhiunla, or Farquharsonnes B56 Bk6 b6 Bk6 B6 G54 R/Y6 G54 Bk20 B56 Bk2 B12 33 Clanngvn G4 Bk32 G4 Bk32 G60 R4 34 Clan-mak-Arthovr Bk64 G12 Bk24 G60 Y6 35 Clanmorgan B8 Bk24 B8 Bk24 B64 R4 36 Makqwhenis Bk4 R14 Bk4 R14 Bk28 Y2 37 Bruiss W8 R56 G14 R12 G38 R10 G38 R12 G14 R56 Y8 38 Dowglass Bk30 Gy2 Bk2 Gy2 Bk14 Gy28 Bk2 Gy4 39 Crawfovrd R6 g24 R6 G24 R60 W4 40 Ruthwen R4 G2 R58 B36 G30 W6 41 Montegomerye B18 G6 B18 G68 42 Hamyltowne B10 R2 B10 R16 W2 43 Wymmis R8 Bk24 W2 Bk24 R8 Bk8 R52 G2 R10 44 Cymyne Bk4 R54 G8 R4 G8 R8 G18 W2 G18 R8 45 Seyntcler G4 R2 G60 Bk32 W2 B32 R4 46 Dvnbarr R8 Bk2 R56 Bk16 G44 R12 47 Leslye Bk2 R64 B32 R8 Bk12 Y2 Bk12 R8 48 Lavdere G6 B16 G6 Bk8 G30 R4 49 Connyngham Bk8 R2 Bk60 R56 B2 R2 W8 50 Lyndeseye G50 B4 G4 B4 G4 b20 R60 B4 R6 51 Haye R12 G8 Y4 G72 R4 G4 R4 G24 R96 G8 R4 G2 R4 W2 52 Dundass Bk4 G4 R2 G48 Bk24 B32 Bk8 53 Ogyluye B58 Y2 B4 Bk32 G52 Bk2 G4 R6 54 Olyfavnt B8 Bk8 B48 G64 W2 G4 55 Setown G10 W2 G24 R10 B8 R4 Bk8 R64 G2 R4 56 Ramsey Bk8 W4 Bk56 R60 Bk2 R6 57 Areskyn G14 R2 G52 R60 G2 R10 58 Wallas Bk4 R64 Bk60 Y8 59 Brodye Bk10 R60 Bk28 Y2 Bk28 R10 60 Barclay G4 B64 G64 R4 61 Murrawe B56 Bk6 B6 Bk6 B6 Bk20 G54 R6 g54 Bk20 B56 Bk2 B12 62 Urqwhart B4 W2 B24 Bk4 B4 Bk4 B8 Bk24 G52 Bk4 G4 R2 63 Rose G4 R48 B10 R8 B2 R4 B2 R24 W4 64 Colqwohovne B8 Bk4 B40 W2 Bk18 G58 R8 65 Drymmond G4 R2 g2 R56 G16 Bk2 G2 Bk2 G36 R2 G2 R8 66 Forbas R4 G64 Bk36 G10 Bk16 Y4 67 Scott G8 R6 Bk2 R56 G28 R8 G8 W6 G8 R8 68 Armstrang G4 Bk2 G58 Bk24 B4 Bk2 B2 Bk2 B26 R6 69 Gordovn B60 Bk2 B2 Bk2 B8 Bk28 G52 Y2 G2 Y4 G2 Y2 G52 Bk28 B40 Bk2 B8 70 Cranstoun Dg28 B2 Dg2 B2 Dg6 B12 Lg24 R4 71 Graeme G24 Bk8 G2 Bk8 72 Maxswel R6 G2 R56 Bk12 R8 G32 R6 73 Home B6 G4 B60 Bk20 R2 Bk4 R2 Bk70 74 Johnstoun Bk4 B4 Bk4 B48 G60 Bk2 G4 Y6 75 Kerr G40 Bk2 G4 Bk2 G6 Bk28 R56 K2 R4 K8Enjoy, The point of world view Link to comment Share on other sites More sharing options...
ValeryVal Posted April 20, 2010 Author Share Posted April 20, 2010 This is new more optimized version of ATartan. It uses new method for tartan visualization to improve speed and quality. For silk or metalic thread you can set Global $EllipseThread = False expandcollapse popup;=================================================== ; ATartan by Valery Ivanov, 30 March 2010 ;=================================================== ; History ; 1 April: ; - Parts of tartan code can be delimited by space " " (or "," ) ; - More short source ; - New color ("K" means Black) ; - Tartan can use Gy as Gray (used to D) and Bk as Black (used to K) ; - Strip double (or more) spaces between words, leading and trailing white spaces! ; 16 April: ; - New methods (image templates) to improve speed and quality #include <GDIPlus.au3> #include <GuiConstantsEx.au3> #include <ScreenCapture.au3> #include <WinAPI.au3> Opt('MustDeclareVars', 1) ; Normal Thread Global $EllipseThread = True ; Silk or metalic thread ;Global $EllipseThread = False Global $YellowFront = 0xFFECDC00, $YellowBack = 0xFFD4B300 Global $BlueFront = 0xFF3C9CE0, $BlueBack = 0xFF08419C Global $RedFront = 0xFFE03C9C, $RedBack = 0xFF9C0841 Global $GreenFront = 0xFF3CE09C, $GreenBack = 0xFF089C41 Global $GrayFront = 0xFFC8C8C8, $GrayBack = 0xFF8E8E8E Global $WhiteFront = 0xFFFFFFFF, $WhiteBack = 0xFFC8C8C8 Global $BlackFront = 0xFF404040, $BlackBack = 0xFF000000 Global $FrontColor_Yellow = $YellowFront, $BackColor_Yellow = $YellowBack Global $FrontColor_Blue = $BlueFront, $BackColor_Blue = $BlueBack Global $FrontColor_Gray = $GrayFront, $BackColor_Gray = $GrayBack Global $FrontColor_Red = $RedFront, $BackColor_Red = $RedBack Global $FrontColor_Green = $GreenFront, $BackColor_Green = $GreenBack Global $FrontColor_White = $WhiteFront, $BackColor_White = $WhiteBack Global $FrontColor_Black = $BlackFront, $BackColor_Black = $BlackBack ;Tartan description Global $ColorFullNames = StringSplit("Yellow,Blue,Gray,Red,Green,White,Black",",") Global $ColorShortNames = StringSplit("Y,B,D,R,G,W,K",",") Global $TartanShortCode = "R12 D4 B12 D4 G12 D4 Y12 W4 Y12 D4 G12" Global $TartanShortSet = StringSplit($TartanShortCode,",") ;Middle strip is skipped Global $Tartan_count = 2*$TartanShortSet[0]-1 Global $hBrushFront, $hBrushBack Global $Zoom = 1.0, $Size = Round(90/$Zoom) Global $nHeight = Round(50/$Zoom), $nWidth = Round(50/$Zoom) Global $hCloneV, $hCloneH Global $hGUI Global $RedrawButton, $SaveButton, $ZoomButton, $Pic, $hPic, $Msg Global $CodeLabel, $CreateButton Global $hBitmap1, $hImage1 Global $hBmpSource, $hImageSource Global $hGraphic Global $FileSaved = @ScriptDir & "\Tartan_tmp.jpg" Global $Caption = "ATartan © Valery Ivanov, 30 March 2010" ; Create GUI $hGUI = GUICreate($Caption, 900, 800) GUICtrlCreateGroup("Actions:", 10, 10, 170, 780) GUICtrlSetFont(-1, 10, 800, 0, "Verdana") $RedrawButton = GUICtrlCreateButton("Recreate", 40, 40, 110, 20) GUICtrlSetFont(-1, 10, 800, 0, "Verdana") $ZoomButton = GUICtrlCreateButton("Zoom", 40, 70, 110, 20) GUICtrlSetFont(-1, 10, 800, 0, "Verdana") $SaveButton = GUICtrlCreateButton("Save", 40, 100, 110, 20) GUICtrlSetFont(-1, 10, 800, 0, "Verdana") GUICtrlCreateGroup("Code:", 185, 10, 710, 55) GUICtrlSetFont(-1, 10, 800, 0, "Verdana") $CodeLabel = GUICtrlCreateInput($TartanShortCode, 200, 40, 500, 20) GUICtrlSetFont(-1, 10, 800, 0, "Verdana") $CreateButton = GUICtrlCreateButton("Create", 720, 40, 110, 20) GUICtrlSetFont(-1, 10, 800, 0, "Verdana") GUICtrlCreateGroup("Tartan:", 185, 75, 710, 720) GUICtrlSetFont(-1, 10, 800, 0, "Verdana") If FileExists($FileSaved) then $Pic = GUICtrlCreatePic($FileSaved, 190, 90, 700, 700) else $Pic = GUICtrlCreatePic("", 190, 90, 700, 700) endif GUISetState() ; Initialize GDI+ library _GDIPlus_Startup() ; Capture client area $hPic = ControlGetHandle($Caption, "", "Static1") ; Make there bitmap, image and graphics $hBitmap1 = _ScreenCapture_CaptureWnd("", $hPic) $hImage1 = _GDIPlus_BitmapCreateFromHBITMAP($hBitmap1) $hGraphic = _GDIPlus_ImageGetGraphicsContext($hImage1) CreateBrushes() TartanParse($TartanShortCode) CreateColorElements($hGraphic) If Not FileExists($FileSaved) then DrawPlaid($hGraphic) While 1 $Msg = GUIGetMsg() switch $Msg case $GUI_EVENT_CLOSE ExitLoop case $CreateButton $TartanShortCode = StringStripWS(GUICtrlRead($CodeLabel),7) $TartanShortCode = StringReplace($TartanShortCode,"Bk", "K") $TartanShortCode = StringReplace($TartanShortCode,"Gy", "D") TartanParse($TartanShortCode) DrawPlaid($hGraphic) case $RedrawButton DrawPlaid($hGraphic) case $SaveButton SaveTartan() case $ZoomButton $Zoom /= 2 if $Zoom < 0.25 then $Zoom = 2 DrawPlaid($hGraphic) endswitch WEnd ; Clean up resources DisposeColorElements() DisposeBrushes() _GDIPlus_ImageDispose($hImage1) _WinAPI_DeleteObject($hBitmap1) ; Shut down GDI+ library _GDIPlus_Shutdown() ;===================================== ; Save Tartan Image func SaveTartan() local $FileName $FileName = FileSaveDialog( "Choose a name.", @ScriptDir, "Image file (*.jpg)", 16, "Tartan.jpg") if @error then MsgBox(4096,"","Save cancelled.") else FileCopy($FileSaved, $FileName, 1) endif endfunc ;===================================== ; Create Brushes func CreateBrushes() local $Col for $i = 1 to $ColorFullNames[0] $Col = $ColorFullNames[$i] Assign("hBrushFront_" & $Col,_GDIPlus_BrushCreateSolid (Eval("FrontColor_" & $Col)),2) Assign("hBrushBack_" & $Col,_GDIPlus_BrushCreateSolid (Eval("BackColor_" & $Col)),2) next endfunc ;===================================== ; Dispose Brushes func DisposeBrushes() local $Col for $i = 1 to $ColorFullNames[0] $Col = $ColorFullNames[$i] _GDIPlus_BrushDispose (Eval("hBrushFront_" & $Col)) _GDIPlus_BrushDispose (Eval("hBrushBack_" & $Col)) next endfunc ;===================================== ; Create ColorElements func CreateColorElements($hG) local $Color if Eval("hCloneV_White") then DisposeColorElements() for $i = 1 to $ColorFullNames[0] $Color = $ColorFullNames[$i] Create_VCells($hG,$Color,$Zoom) Create_HCells($hG,$Color,$Zoom) next endfunc ;===================================== ; Dispose ColorElements func DisposeColorElements() local $Col for $i = 1 to $ColorFullNames[0] $Col = $ColorFullNames[$i] _GDIPlus_ImageDispose(Eval("hCloneV_" & $Col)) _GDIPlus_ImageDispose(Eval("hCloneH_" & $Col)) next endfunc ;===================================== ; Create Vertical Cells func Create_VCells($hG,$Color,$Zoom) local $hBrushFront, $hBrushBack _GDIPlus_GraphicsClear ($hG,0xFFFFFFFF) $hBrushFront = Eval("hBrushFront_" & $Color) $hBrushBack = Eval("hBrushBack_" & $Color) _GDIPlus_GraphicsFillRect($hG, 0,0, 8, 16, $hBrushBack) if $EllipseThread then _GDIPlus_GraphicsFillEllipse($hG, 0,0, 7, 15, $hBrushFront) else _GDIPlus_GraphicsFillRect($hG, 0,0, 7, 15, $hBrushFront) endif Assign("hCloneV_" & $Color, _GDIPlus_BitmapCloneArea ($hImage1, 0, 0, 8, 16, $GDIP_PXF24RGB),2) endfunc ;===================================== ; Create Horizontal Cells func Create_HCells($hG,$Color,$Zoom) local $hBrushFront, $hBrushBack _GDIPlus_GraphicsClear ($hG,0xFFFFFFFF) $hBrushFront = Eval("hBrushFront_" & $Color) $hBrushBack = Eval("hBrushBack_" & $Color) _GDIPlus_GraphicsFillRect($hG, 0,0, 16, 8, $hBrushBack) if $EllipseThread then _GDIPlus_GraphicsFillEllipse($hG, 1,0, 15, 7, $hBrushFront) else _GDIPlus_GraphicsFillRect($hG, 1,0, 15, 7, $hBrushFront) endif Assign("hCloneH_" & $Color, _GDIPlus_BitmapCloneArea ($hImage1, 0, 0, 16, 8, $GDIP_PXF24RGB),2) endfunc ;===================================== ; Draw Plaid func DrawPlaid($hG) local $PosMax, $NStrip = 1, $CurColor Local $Step = 0, $iStep = 0 _GDIPlus_GraphicsClear ($hG,0xFFFFFFFF) GUICtrlSetImage ($Pic, $FileSaved) $Size = Round(90/$Zoom) $nHeight = Round(50/$Zoom) $nWidth = Round(50/$Zoom) $PosMax = $Tartan_Width_1 - 1 $CurColor = $Tartan_Color_1 $NStrip = 1 ProgressOn("ATartan progress", "Working...", "0 percent") for $i = 0 to $Size $Step += 1 if $Step = Round($Size/100) then $iStep += 1 ProgressSet( $iStep, $iStep & " percent") $Step = 0 endif if $i > $PosMax then $NStrip += 1 if $NStrip > $Tartan_count then $CurColor = "White" else $PosMax += Eval("Tartan_Width_" & $NStrip) $CurColor = Eval("Tartan_Color_" & $NStrip) endif endif Create_Ver_Thread($hG,$i,$CurColor) Create_Hor_Thread($hG,$i,$CurColor) next ProgressSet(100 , "Done", "Complete") sleep(500) ProgressOff() _GDIPlus_ImageSaveToFile($hImage1, $FileSaved) GUICtrlSetImage ($Pic, $FileSaved) endfunc ;===================================== ; Draw Vertical Thread func Create_Ver_Thread($hG,$nCol,$Color) local $iX, $iYStart, $iY, $i $iX = +8*$Zoom*($nCol-1) $iYStart = -8*$Zoom*($nCol-1) for $i = -$nHeight to $nHeight $iY = $iYStart+32*$Zoom*$i if $iX >= -9*$Zoom and $iY >= -13*$Zoom then _GDIPlus_GraphicsDrawImageRectRect ($hG, Eval("hCloneV_"& $Color), 0, 0, 8, 16, $iX,$iY, 8*$Zoom, 16*$Zoom) endif next endfunc ;===================================== ; Draw Horizontal Thread func Create_Hor_Thread($hG,$nRow,$Color) local $iX, $iY, $iXStart, $i $iXStart = 8*$Zoom-8*$Zoom*($nRow-1) $iY = 8*$Zoom+8*$Zoom*($nRow-1) for $i = -$nWidth to $nWidth $iX = $iXStart+32*$Zoom*$i if $iX >= -25*$Zoom and $iY >= -9*$Zoom then _GDIPlus_GraphicsDrawImageRectRect ($hGraphic, Eval("hCloneH_"&$Color), 0, 0, 16, 8, $iX,$iY, 16*$Zoom, 8*$Zoom) endif next endfunc ;===================================== ; Parse Tartan Code func TartanParse($TCode) local $Color, $Width local $TSet = StringSplit($TCode,", ") $Tartan_count = 2*$TSet[0]-1 For $i = 1 To $TSet[0]-1 $Color = ColorName(StringLeft($TSet[$i],1)) $Width = StringTrimLeft($TSet[$i],1) Assign("Tartan_Color_" & $i,$Color,2) Assign("Tartan_Width_" & $i,$Width,2) Assign("Tartan_Color_" & $Tartan_count+1-$i,$Color,2) Assign("Tartan_Width_" & $Tartan_count+1-$i,$Width,2) next $Color = ColorName(StringLeft($TSet[$TSet[0]],1)) $Width = StringTrimLeft($TSet[$TSet[0]],1) Assign("Tartan_Color_" & $TSet[0],$Color,2) Assign("Tartan_Width_" & $TSet[0],$Width,2) endfunc ;===================================== ; Get full name of color by it's short name func ColorName($ColorShortName) local $DefaultColorName = "White" For $i = 1 To $ColorFullNames[0] if $ColorShortName = $ColorShortNames[$i] then return $ColorFullNames[$i] next return $DefaultColorName endfunc Enjoy, The point of world view Link to comment Share on other sites More sharing options...
AlmarM Posted April 21, 2010 Share Posted April 21, 2010 Wow, great! I like , Mayby make an accelerator. When you press enter, you automaticly 'click' Generate. 5/5 Minesweeper A minesweeper game created in autoit, source available. _Mouse_UDF An UDF for registering functions to mouse events, made in pure autoit. 2D Hitbox Editor A 2D hitbox editor for quick creation of 2D sphere and rectangle hitboxes. Link to comment Share on other sites More sharing options...
corgano Posted April 21, 2010 Share Posted April 21, 2010 (edited) I like it. No cheep quality or silly tricks required. Requests: This could be used for making textures, What if it could accept 0xffa0df color codes? (<numberof>x<hexcolor>, so 12xff0000 would be = to R12) You have space on the bottom left of the GUI, you could have a little box where people could see / select colors. I liked in the first version how you could see it work. how about the option to watch it go? EDIT I have been attempting to make it use hex codes and i can't figure Eval("hCloneV_"& $Color) out. It converts the color name to a RGB or hex color number, Right? Edited April 21, 2010 by corgano 0x616e2069646561206973206c696b652061206d616e20776974686f7574206120626f64792c20746f206669676874206f6e6520697320746f206e657665722077696e2e2e2e2e Link to comment Share on other sites More sharing options...
ValeryVal Posted April 22, 2010 Author Share Posted April 22, 2010 When you press enter, you automaticly 'click' Generate.New ATartan knows about {Enter} key, now. What if it could accept 0xffa0df color codes?Names of colors (800+) taken from here New ATartan uses color layout from the following CShades.ini file. CShades.ini: expandcollapse popup[CShades] snow4=F2F2F2;D0CFCF;ADACAC;8B8989 snow3=F3F2F2;E6E4E4;DAD7D7;CDC9C9 snow2=F4F1F1;F2EEEE;F0ECEC;EEE9E9 rosybrown4=F4F0F0;D2C3C3;AF9595;8B6969 dustyrose=F4F0F0;D0C0C0;AC9090;856363 salmon5=F5EFEF;CFAFAF;A96E6E;6F4242 rosybrown=F5EFEF;E2CFCF;CFAFAF;BC8F8F rosybrown3=F7EEEE;E9D2D2;DBB7B7;CD9B9B indianred4=F7EDED;DBA9A9;BF6666;8B3A3A sgisalmon=F8EDED;E7C4C4;D79A9A;C67171 brown=FAEBEB;E7A1A1;D55858;A62A2A indianred=FCE8E9;F19499;E64049;B0171F indianred3=F9EBEB;EAB9B9;DC8787;CD5555 brown4=FAEBEB;E59898;D04545;8B2323 firebrick5=FAEBEB;E69898;D14646;8E2323 orange=FFF6E5;FFDB99;FFC04D;FFA500 brown3=FAEBEB;EBADAD;DC7070;CD3333 rosybrown2=FAEAEA;F6D8D8;F2C6C6;EEB4B4 firebrick4=FBEAEA;EA9090;D93636;8B1A1A firebrick=FBEAEA;EC9D9D;DE5151;B22222 firebrick3=FBE9E9;EEA6A6;E26262;CD2626 brownmadder=FBE9E9;F1A9A9;E66969;DB2929 scarlet=FBE9E9;EC8D8D;DD3131;8C1717 lightcoral=FCE8E8;F8C5C5;F4A3A3;F08080 indianred2=FCE8E8;F8BCBC;F38F8F;EE6363 brown2=FDE8E8;F8AEAE;F37575;EE3B3B firebrick2=FDE7E7;F8A9A9;F36A6A;EE2C2C darkcherryred=FFE5E5;FF5555;C30000;330000 bloodred=FFE5E5;FF6666;E60000;660000 maroon=FFE5E5;FF6F6F;F70000;800000 darkred=FFE5E5;FF7272;FE0000;8B0000 red3=FFE5E5;FF8888;FF2B2B;CD0000 red2=FFE5E5;FF9393;FF4141;EE0000 red=FFE5E5;FF9999;FF4D4D;FF0000 firebrick1=FFE5E5;FFA9A9;FF6D6D;FF3030 novascotia salmon=FFE5E5;FFAAAA;FF6F6F;FF3333 brown1=FFE5E5;FFAEAE;FF7777;FF4040 seattle salmon=FFE5E5;FFBBBB;FF9090;FF6666 indianred1=FFE5E5;FFBCBC;FF9393;FF6A6A rosybrown1=FFE5E5;FFD9D9;FFCDCD;FFC1C1 flatpink=FFE5E5;FFDDDD;FFD5D5;FFCCCC snow=FFFAFA;FFFAFA;FFFAFA;FFFAFA chili=FAEBEA;EEB5B2;E17F7A;D44942 cadmiumreddeep=FEE8E7;F99E9A;F5554D;E3170D mistyrose3=F5F0F0;E7DDDC;DACAC9;CDB7B5 cola=F9EDEB;E5AFAA;D17268;AF4035 piglet snout=F9EDEB;F5DFDD;F0D1CE;ECC3BF bloodorange=FFE8E5;FF9288;FF3C2A;CC1100 mistyrose2=F8EEEC;F5E5E4;F1DDDB;EED5D2 salmon=FEE9E6;FDC6C0;FBA399;FA8072 mistyrose=FFE8E5;FFE7E4;FFE5E2;FFE4E1 mistyrose4=F3F2F1;D0CBCA;AEA4A2;8B7D7B orangered=FFE5F2;FF99CC;FF4DA5;FF007F burntumber=FAEDEB;E4A499;CF5B47;8A3324 tomato3=FAEDEB;EBB8AF;DC8474;CD4F39 tomato2=FDEBE8;F8BBB0;F38C79;EE5C42 safety cone=FFE9E5;FFB7AA;FF856F;FF5333 tomato=FFE9E5;FFBDB1;FF907C;FF6347 coral4=F9EEEC;DFACA2;C66957;8B3E2F tomato4=FAEDEB;E4A69A;CE5F4A;8B3626 coral3=FAEDEB;EBBDB4;DC8C7C;CD5B45 coral2=FDEBE8;F8C0B5;F39583;EE6A50 coral1=FFEAE5;FFC2B6;FF9A86;FF7256 englishred=FCECE8;F3AF9F;EA7256;D43D1A nectarine=FFEBE5;FFAD99;FF704D;FF3300 greenishumber=FFEBE5;FFB19D;FF7755;FF3D0D salmon4=F8EFED;DCB5A9;C07A65;8B4C39 salmon3=F9EEEB;EAC4B9;DC9A86;CD7054 chili powder=FCEDE8;F3AE9A;EA6F4B;C73F17 salmon2=FDEDE8;F8C9BB;F3A68F;EE8262 salmon1=FFEBE5;FFCCBC;FFAC92;FF8C69 sandstone=F4F1F0;DBD0CC;C1AEA8;A78D84 darksalmon=FBEEE9;F5D0C4;EFB39F;E9967A fleshochre=FFECE5;FFBAA4;FF8962;FF5721 sepia=FBEEEA;E79C81;C65026;5E2612 orangered4=FFECE5;FF9872;FE4400;8B2500 orangered3=FFECE5;FFA888;FF642B;CD3700 orangered2=FFECE5;FFB093;FF7441;EE4000 coral=FFECE5;FFC8B4;FFA382;FF7F50 lightsalmon4=F7F0EE;D9BBAF;BB856F;8B5742 lightsalmon3=F9EFEC;EACBBE;DCA690;CD8162 lightsalmon2=FCEEE8;F8D0C1;F3B399;EE9572 kidney bean=FDEEE7;F5AC8E;EE6A34;B13E0F maroon5=FFEDE6;FE9469;E64402;691F01 lightsalmon=FFEDE5;FFD3C2;FFBA9E;FFA07A verydarkbrown=F6F1EF;CDB2A5;A5735C;5C4033 feldspar=F9F0EC;EBD1C4;DEB19D;D19275 sienna=FAF5EB;E6CC98;D1A446;8E6B23 sienna3=FAEFEB;EBC2AF;DC9574;CD6839 burntsienna=FBEAEA;E77E7F;C12427;551011 sienna2=FDEEE8;F8C7B0;F3A079;EE7942 orange5=FFEEE5;FFC8AE;FFA377;FF7D40 sienna1=FFEEE5;FFCAB1;FFA67C;FF8247 sienna4=FAF0EB;E4B29A;CE754A;8B4726 tan=F8F3ED;EBDECC;DFC9AC;D2B48C brownochre=FAF0EA;E6B094;D3703E;87421F chocolate=FCF1E9;F2C3A1;E7955A;D2691E ivoryblack=F4F2F1;B7ACA5;75675E;292421 darktan=F6F1EE;D9C3B7;BC957F;97694F vandykebrown=FEEFE7;F7A06D;D8570B;5E2605 apricot=FEEFE6;FDD5BD;FCBB95;FBA16C cadmiumorange=FFEFE5;FFC09A;FF904F;FF6103 marsorange=FCF0E8;F0B28C;E37330;964514 mandarianorange=FCF0E8;F4C8AC;ECA06F;E47833 oregon salmon=FFEFE5;FFC7A4;FF9F63;FF7722 semisweet chocolate1=F8F1EC;DBB399;BD7645;6B4226 bakerschocolate=FAF1EB;E1AC88;BF6A30;5C3317 deepochre=FAF1EA;E5B08D;D06F2F;733D1A peach=FEF5E6;FEF3E2;FEF2DF;FEF0DB mediumwood=F6F2EF;DBCCC1;C1A692;A68064 darkwood=F7F2EE;D7BFAE;B78D6F;855E42 lightwood=FAF1EB;F4E1D4;EFD2BD;E9C2A6 chocolate3=FCF1E9;F1C2A0;E79256;CD661D saddlebrown=FCF1E9;EFB389;E27629;8B4513 chocolate2=FDF0E7;F8C8A5;F39F63;EE7621 chocolate1=FFF0E5;FFCAA5;FFA564;FF7F24 seashell=FFF5EE;FFF5EE;FFF5EE;FFF5EE seashell3=F4F2F1;E7E3E0;DAD4D0;CDC5BF seashell2=F6F2EE;F4EDE9;F1E9E3;EEE5DE sign brown=FBF1E9;E9AD80;C96B24;603311 marsyellow=FCF1E8;F4C6A3;ED9B5E;E3701A rawsienna=FDF1E8;F5BF97;ED8E47;C76114 seashell4=F3F2F2;D0CECD;AEAAA7;8B8682 desert sand=FEF1E6;FEEEE1;FEEBDB;FEE8D6 titanium=F3F2F1;DFDCD9;CAC5C1;B6AFA9 peachpuff4=F4F2F0;D2C9C1;B0A092;8B7765 peachpuff3=F7F2EE;E9DCD0;DBC5B3;CDAF95 peachpuff2=FBF2EA;F6E5D6;F2D8C1;EECBAD sandybrown=FDF1E7;FAD8BA;F7BE8D;F4A460 peachpuff=FFE5E9;FFD3D9;FFC0C9;FFADB9 tan4=F9F2EC;E1BF9F;C98C52;8B5A2B copper=F9F2EB;E7C8AA;D59D69;B87333 tan2=FDF2E8;F8D5B3;F3B77E;EE9A49 coffee=FFF2E6;FDBC80;FB861A;AA5303 tan1=FFF2E5;FFD8B3;FFBF81;FFA54F espresso=FAF2EB;F3E4D4;EDD5BC;E7C6A5 peru=FAF2EB;EBCEB2;DCA978;CD853F gold5=FAF2EB;EBCCAD;DCA56F;CC7F32 gold6=FAF2EA;EBCCAD;DCA570;CD7F32 linen=FBF2EA;FAF1E8;FAF1E7;FAF0E6 ochre=FBF2E9;F0C9A3;E4A05C;CC7722 darkorange4=FFF2E5;FFB872;FE7E00;8B4500 darkorange3=FFF2E5;FFC388;FF952B;CD6600 darkorange2=FFF2E5;FFC993;FF9F41;EE7600 darkorange1=FFF2E5;FFCC99;FFA54D;FF7F00 sand=FFF2E5;FFE6CC;FFD9B2;FFCC99 goldochre=FBF2EA;EECAA4;E0A15F;C77826 melon=FBF3EA;F3DABF;EBC194;E3A869 yellowochre=FDF3E8;F5CDA1;EEA85A;E38217 cinnamon=FFF5E5;FFCB7D;FFA114;AA6600 bisque3=F6F3EE;E9DFD3;DBCBB9;CDB79E newtan=FBF3EA;F5E4D1;F0D6B7;EBC79E light copper=FBF3E9;F7E3CC;F2D3B0;EDC393 sign orange=FFF3E5;FFCA8E;FFA036;DD7500 darkorange5=FFF3E5;FFCF99;FFAA4D;FF8600 antiquewhite3=F5F3EF;E8E2DA;DAD1C5;CDC0B0 burlywood4=F5F3EF;D4C8B9;B39E83;8B7355 bisque2=FAF3EA;F6E9D9;F2DFC8;EED5B7 carrot=FDF3E7;F8D3A5;F2B263;ED9121 darkorange=FFF3E5;FFD199;FFAF4D;FF8C00 bisque=FFF3E5;FFEEDA;FFE9CF;FFE4C4 antiquewhite1=FFF4E5;FFF2E2;FFF1DF;FFEFDB bisque4=F4F2F1;D1CBC4;AFA497;8B7D6B beige dark=F4F3F0;D9D3CB;BEB4A5;A39480 burlywood3=F8F3ED;EADBC7;DBC2A2;CDAA7D antiquewhite2=F9F3EC;F5ECE1;F2E6D7;EEDFCC burlywood=F9F3EB;F0DFCA;E7CCA8;DEB887 brick=FBF3EA;EAC697;DA9944;9C661F burlywood2=FCF3E9;F7E4CC;F3D4AE;EEC591 antiquewhite=FCF4E8;FBF1E3;FBEEDD;FAEBD7 cool copper=FCF4E8;F4D0A0;ECAC57;D98719 eggshell=FEF4E7;FDEFDD;FDEBD3;FCE6C9 cadmiumyellow=FFF4E5;FFD69F;FFB759;FF9912 burlywood1=FFF4E5;FFE9CD;FFDEB4;FFD39B antiquewhite4=F3F2F1;D0CDC9;AEA8A0;8B8378 rawumber=FCF4E9;ECC084;D88B22;734A12 navajowhite4=F5F3F0;D3CABE;B1A28C;8B795E navajowhite3=F7F3ED;E9DECC;DBC8AC;CDB38B navajowhite2=FBF4E9;F7E8D1;F2DBB9;EECFA1 bread=FEF4E6;FEEACE;FDDFB5;FCD59C aureolineyellow=FFF5E5;FFDBA5;FFC264;FFA824 cheddar=FFF5E5;FFE5BC;FFD492;FFC469 navajowhite=FFF5E5;FFEDD3;FFE6C0;FFDEAD blanchedalmond=FFF5E5;FFF2DD;FFEED5;FFEBCD bronzeii=F8F4EC;E1CDAE;CAA66F;A67D3D beach sand=FBF4EA;F6EAD6;F2E0C3;EED6AF papayawhip=FFF5E5;FFF3E0;FFF1DB;FFEFD5 naplesyellowdeep=FFF6E5;FFDC9F;FFC259;FFA812 moccasin=FFF6E5;FFF0D5;FFEAC5;FFE4B5 wheat4=F4F3F0;D2CCC1;B0A593;8B7E66 bronze=F6F3EF;D5CBB8;B5A382;8C7853 wheat3=F7F4EE;E9E0D0;DBCDB3;CDBA96 wheat2=FBF5EA;F6EBD6;F2E2C2;EED8AE wheat=F5F5EF;ECECDF;E2E2CF;D8D8BF oldlace=FDF6E7;FDF5E7;FDF5E6;FDF5E6 orange4=FFF6E5;FFCD72;FEA500;8B5A00 orange3=FFF6E5;FFD588;FFB52B;CD8500 orange2=FFF6E5;FFD993;FFBC41;EE9A00 wheat1=FFF6E5;FFF1D7;FFECC8;FFE7BA organic tea=FBF5EA;EBD19E;DBAD51;AC7F24 gold7=FFF6E5;FFDD99;FFC34D;FFAA00 cadmium yellowlight=FFF7E5;FFDF9E;FFC857;FFB00F floralwhite=FFFAF0;FFFAF0;FFFAF0;FFFAF0 dark wheat=FBF5E9;F5E6C7;EED6A4;E8C782 pyridiumorange=FFF7E6;FDDE97;FCC548;F0A804 packer gold=FFF7E6;FEE1A0;FDCB5A;FCB514 honey=FFF7E6;FEF1D3;FEEBBF;FEE5AC darkgoldenrod1=FFF8E5;FFE39E;FFCE57;FFB90F canvas=F6F4EE;DAD1B8;BEAE82;9D8851 goldenrod=FAFAEB;F0F0C2;E5E599;DBDB70 goldenrod4=FCF6E9;EED18A;E0AD2B;8B6914 goldenrod3=FCF6E9;F1DAA0;E7BE56;CD9B1D goldenrod2=FDF7E7;F8E1A6;F3CA64;EEB422 darkgoldenrod4=FEF7E7;F7D47D;F1B112;8B6508 darkgoldenrod=FEF7E7;F8D98C;F3BB31;B8860B darkgoldenrod3=FEF7E7;F9DB93;F4BF3E;CD950C darkgoldenrod2=FEF7E7;F9DF9E;F5C655;EEAD0E goldenrod1=FFF8E5;FFE5A5;FFD365;FFC125 semisweet chocolate2=FCF7E8;F5E1A7;EDCA67;E6B426 mustard=FFFAE5;FFEA9F;FFDB58;FFCC11 stainless steel=F3F3F1;EDECEA;E6E6E2;E0DFDB cornsilk=FFFAE5;FFF9E2;FFF9DF;FFF8DC ash=F4F3F1;E5E3DD;D5D3C9;C6C3B5 cornsilk3=F5F4EF;E8E5DB;DAD7C6;CDC8B1 cornsilk2=F9F6EC;F5F1E2;F2EDD7;EEE8CD oldgold=FAF7EB;ECE1B0;DDCB76;CFB53B sign yellow=FFFAE6;FEECA1;FDDF5B;FCD116 buttermilk=FFFAE6;FEF7D6;FEF4C5;FEF1B5 light goldenrod4=F6F5EF;D6D1B4;B6AD7A;8B814C light goldenrod3=F8F6EC;EAE4C3;DBD199;CDBE70 lightgoldenrod2=FCF9E9;F7EFC6;F3E6A4;EEDC82 light goldenrod1=FFFBE5;FFF6C7;FFF1A9;FFEC8B cornsilk4=F3F3F1;D0CFC9;AEACA0;8B8878 sgibrightgray=F5F4F0;E5E3D9;D5D2C1;C5C1AA banana=FBF9E9;F3EBB8;EBDD88;E3CF57 lightgoldenrod=FCF9E9;F7F0C6;F3E6A4;EEDD82 gold4=FFFBE5;FFE972;FED600;8B7500 gold3=FFFBE5;FFEC88;FFDE2B;CDAD00 gold2=FFFBE5;FFEE93;FFE141;EEC900 gold=FFFBE5;FFEF99;FFE34D;FFD700 brass=F8F7EC;E3DDB2;CEC378;B5A642 cream city brick=F8F7ED;F1EEDA;E9E6C8;E2DDB5 grapefruit=FDFAE8;F9F4CA;F6EEAC;F3E88E cadmiumlemon=FFFCE5;FFF49A;FFEB4F;FFE303 lemonchiffon3=F6F5EF;E8E6D6;DBD8BE;CDC9A5 lemonchiffon2=FAF8EB;F6F3DC;F2EECE;EEE9BF khaki=F5F5EF;D9D9BF;BCBC8F;9F9F5F corn=FEFCE6;FDF7B8;FCF18B;FBEC5D yolk=FFFDE5;FFF599;FFEE4D;FFE600 lemonchiffon=FFFCE5;FFFCDD;FFFBD5;FFFACD tank=F5F4F0;CAC8AE;A09B6C;615E3F khaki4=F6F5EF;D6D3B6;B6B17C;8B864E khaki3=F8F7EC;EAE7C4;DBD69B;CDC673 palegoldenrod=FBF9EA;F7F3D5;F2EEBF;EEE8AA khaki2=FCFAE9;F7F4C7;F3EDA6;EEE685 khaki1=FFFDE5;FFFBC9;FFF8AC;FFF68F lemonchiffon4=F4F3F1;D1D0C6;AEAD9B;8B8970 darkkhaki=F7F6ED;E4E1C2;D0CC96;BDB76B coconut=FFFDE5;FFFDDE;FFFCD7;FFFCCF fog=F4F4F0;E7E6DD;D9D8C9;CBCAB6 green grape=FDFCE8;F5F49A;EDEB4C;CECC15 ivory4=F3F3F2;D0D0CD;AEAEA8;8B8B83 lightyellow4=F3F3F1;D0D0CA;AEAEA2;8B8B7A warmgrey=F4F4F1;CECEC3;A8A895;808069 ivory3=F4F4F1;E7E7E1;DADAD1;CDCDC1 lightyellow3=F5F5F0;E8E8DC;DADAC8;CDCDB4 darkolivegreen=F4F7ED;C2D6A1;91B454;556B2F ivory2=F6F6EF;F3F3EA;F1F1E5;EEEEE0 ganegreen=F7F7ED;D8D8A4;B8B85A;777733 sgiolivedrab=F8F8ED;DDDDA8;C2C264;8E8E38 lightyellow2=F8F8EC;F5F5E3;F1F1DA;EEEED1 beige=F9F9EB;F8F8E6;F6F6E1;F5F5DC mediumgoldenrod=FAFAEB;F5F5D7;EFEFC2;EAEAAE brightgold=FCFCE8;F4F4A0;ECEC57;D9D919 lightgoldenrodyellow=FCFCE8;FCFCE1;FBFBD9;FAFAD2 olive=FFFFE5;FFFF6F;F7F700;808000 yellow4=FFFFE5;FFFF72;FEFE00;8B8B00 yellow3=FFFFE5;FFFF88;FFFF2B;CDCD00 ralphyellow=FFFFE5;FFFF88;FFFF2A;CCCC00 yellow2=FFFFE5;FFFF93;FFFF41;EEEE00 yellow=FFFFE5;FFFF99;FFFF4D;FFFF00 papaya=FFFFE5;FFFFC3;FFFFA0;FFFF7E popcornyellow=FFFFE5;FFFFD2;FFFFBE;FFFFAA bone=FFFFE5;FFFFDD;FFFFD5;FFFFCC lightyellow=FFFFE5;FFFFE4;FFFFE2;FFFFE0 ivory=FFFFF0;FFFFF0;FFFFF0;FFFFF0 fire truck green=FDFFE6;F8FD8F;F2FB38;CDD704 avocado=F6F7ED;D9DDB3;BCC37A;98A148 celery=F7F9EC;EAEDC9;DCE2A7;CFD784 pear=FAFCE9;ECF3AB;DFEB6E;D1E231 wasabi sauce=F6F8ED;DEE4B9;C6CF85;AEBB51 battleship=F3F4F1;E8E9E2;DCDDD3;D0D2C4 kermit=F9FDE8;E5F494;D1EC40;A2BC13 key lime pie=F6F9EC;E0E9BB;C9D98B;B3C95A iceberg lettuce=F7FBEA;E9F3C2;DBEC9A;CDE472 titaniumwhite=FCFFF0;FCFFF0;FCFFF0;FCFFF0 safety vest=F9FEE7;E9FBA6;D8F866;C8F526 chromeoxidegreen=F7FCE9;D4EC88;B1DD27;668014 goldgreen=F9FFE5;E5FF8E;D1FF36;AADD00 chartreuse verte=F7FCE8;E4F6AD;D0EF72;BCE937 martini olive=F5F7ED;D3DEB3;B1C578;8BA446 sweet potato vine=F6FAEB;DAE9B0;BED975;A2C93A limepulp=F6FBE9;EBF7CC;DFF2AE;D4ED91 cat eye=EBF2FA;C5DAF0;A0C1E7;7AA9DD jolly green=F7FCE8;DCF39C;C1E950;9CCB19 avacado=F5F8EC;D9E6BB;BED489;A2C257 chrome=F5F9EC;F0F6E4;ECF4DC;E8F1D4 olivedrab4=F5FAEB;CCE697;A3D144;698B22 pea=F2F8ED;C9E0B3;A1C87A;78AB46 olivedrab=F5FAEB;CCE698;A4D146;6B8E23 yellowgreen2=F5FAEB;D6EBAD;B8DC6F;99CC32 yellowgreen=F5FAEA;D7EBAD;B8DC70;9ACD32 olivedrab2=F6FDE8;E0F8AE;C9F374;B3EE3A olivedrab1=F7FFE5;E4FFAE;D2FF76;C0FF3E melonrindgreen=F6FFE5;EEFFD0;E7FFBA;DFFFA5 darkolivegreen4=F4F7ED;C9DAAB;9EBD69;6E8B3D darkolivegreen3=F4F9EB;D9EABB;BDDC8A;A2CD5A darkolivegreen2=F5FCE8;E2F8BD;CFF393;BCEE68 darkolivegreen1=F6FFE5;E7FFBE;D9FF97;CAFF70 greenyellow=F0FAEB;D1F0C2;B2E599;93DB70 terreverte=F3FBE9;B6EA7D;78CA20;385E0F lizard=F2F4F1;BFC6B9;8D9881;5A6351 cactus=F2F4F1;C3CABB;93A086;636F57 fenway grass=F2F7EE;BDD4A5;87B25D;526F35 romaine lettuce=F2F7ED;B5D397;78A947;3B5323 kakapo=F2F9EC;BADE96;83C340;4A7023 chartreuse4=F2FFE5;B8FF72;7EFE00;458B00 chartreuse3=F2FFE5;C3FF88;95FF2B;66CD00 chartreuse2=F2FFE5;C9FF93;9FFF41;76EE00 lawngreen=F2FFE5;CBFF98;A3FF4B;7CFC00 chartreuse=F2FFE5;CCFF99;A5FF4D;7FFF00 kiwi=F2F5F0;CCD7C1;A5B893;7F9A65 soylent green=F2F5EF;D0DCC5;ADC29A;8BA870 wet moss=F2F7EE;B5CE9E;79A251;3D5229 green apple=F2F9EC;C2E1A5;91C95E;629632 tree moss=F2F9EC;C3E2A6;93CC5F;659D32 limerind=F2F9EB;B1DC88;70B234;324F17 flight jacket=F2F3F1;CCCFC9;A5ABA0;7F8778 broccoli=F2F5F0;BECBB4;8BA177;586949 palm=F2F7EE;C1D7AE;90B76D;608341 green mist=F2FBE9;E0F7CC;CEF2AE;BCED91 holly=F2FCE9;B8ED88;7EDE28;488214 od green=F2F4F0;B8C4AE;7E946C;46523C green hornet=F2F5EF;C4D2B9;97AF83;6A8455 camo1=F2F5EF;E6ECE1;DBE4D3;CFDBC5 green pepper=F1FFE6;AFFD71;6EF204;397D02 seaweed roll=F2F4F1;C8CEC3;9EA995;748269 neon green=F1FEE7;CCFBA8;A8F86A;83F52C forestgreen2=F1F7EE;BCD7A9;87B864;567E3A camo3=F2F5EF;D5E0CE;B9CBAD;9DB68C lichen=F1F7EE;E1EDD9;D0E3C4;C0D9AF guacamole=F1F9EC;D8EDCA;BFE2A7;A6D785 cinnabargreen=F1FAEA;BFEAA3;8ED95B;61B329 green goo=F2F4F1;C9D1C4;A0AD97;77896C pond scum=F2F4F0;C3CFBC;95AA88;687E5A douglas fir=F1F7ED;B2D39E;73B04F;3F602B green quartz=F2F5F0;CFD9C9;ADBEA2;8AA37B green cheese=F2F5F0;D1DBCB;B0C2A5;8FA880 seaweed=F2F3F1;C2C9BF;929E8C;646F5E noble fir=F1F7EE;B5D3A5;79AF5C;476A34 green LED=EEFFE6;BEFE9D;8DFD53;5DFC0A spinach=F1F6EF;B4CCA8;77A361;435D36 olive3b=F0F7EE;AFD39E;6DAD4F;3B5E2B frog=F0F7ED;CCE4C1;A8D196;84BE6A kelly=EFFCE8;B4F297;7AE845;4CBB17 park ranger=F2F3F2;B9BDB7;7F887C;484D46 circuit board=F0F8ED;ACD79C;69B64A;3A6629 Nerf green=EDFEE7;B5F99A;7CF44D;49E20E sapgreen=EEFCE9;A2EC88;56DD27;308014 cantaloupe=F2F3F1;D5DBD3;B9C2B6;9CA998 leaf=EFF9EC;BAE4AD;84CF6E;55AE3A green moth=EFF7ED;C8E5C1;A2D296;7BBF6A grass=EEFAEB;B6E8AB;7FD76B;4DBD33 mint ice cream=EFF7ED;E1F0DE;D3EACE;C5E3BF snake=F1F4F1;BDC9BB;889E85;596C56 camo2=F0F6EF;D8E7D6;C1D8BD;A9C9A4 100 euro=EFF7ED;CCE7C7;A9D6A2;86C67C night vision=EEF8EC;C7EAC3;A1DB99;7BCC70 green soap=EDFAEB;CCF0C8;ACE7A4;8CDD81 putting=F0F5F0;C3D6C1;96B792;699864 green lantern=EEF8ED;ABDCA7;69C162;3D8B37 tea leaves=F1F4F1;BFCBBE;8DA28C;5F755E new $20=F1F4F0;DDE5DD;CAD7C9;B7C8B6 green algae=EEF6EE;C0DDC0;91C491;63AB62 wales=ECF9EB;B6E9B5;80D97E;4AC948 honeydew4=F2F3F2;CDD0CD;A8AEA8;838B83 honeydew3=F1F4F1;E1E7E1;D1DAD1;C1CDC1 darkseagreen4=F0F4F0;C3D2C3;95AF95;698B69 darkgreen=E5FFE5;65FF65;00E400;006400 mediumseagreen=ECF9F2;AFE4C6;71D09B;3CB371 palegreen4=EFF5EF;B9D5B9;82B482;548B54 darkseagreen=EFF5EF;CFE2CF;AFCFAF;8FBC8F honeydew2=EFF6EF;EAF3EA;E5F1E5;E0EEE0 darkseagreen3=EEF7EE;D2E9D2;B7DBB7;9BCD9B sgichartreuse=EDF8ED;C4E7C4;9AD79A;71C671 palegreen3=EDF8ED;C7EAC7;A2DBA2;7CCD7C huntergreen=ECF8EC;94D994;40B640;215E21 forestgreen=EBFAEB;97E697;44D144;228B22 limegreen=EAFAEA;ADEBAD;70DC70;32CD32 darkseagreen2=EAFAEA;D8F6D8;C6F2C6;B4EEB4 lightgreen=E9FCE9;CBF7CB;AEF3AE;90EE90 palegreen=E6FEE6;CCFDCC;B2FCB2;98FB98 pinegreen=E5FFE5;55FF55;00C300;003300 dumpster=E5FFE5;5EFF5E;00D600;004F00 green=E5FFE5;6FFF6F;00F700;008000 green4=E5FFE5;72FF72;00FE00;008B00 irish flag=E5FFE5;77FF77;09FF09;009900 green3=E5FFE5;88FF88;2BFF2B;00CD00 green2=E5FFE5;93FF93;41FF41;00EE00 lime=E5FFE5;99FF99;4DFF4D;00FF00 parrotgreen=E5FFE5;AAFFAA;6FFF6F;33FF33 wasabi=E5FFE5;BBFFBB;90FF90;66FF66 palegreen1=E5FFE5;CCFFCC;B3FFB3;9AFF9A darkseagreen1=E5FFE5;D9FFD9;CDFFCD;C1FFC1 offwhitegreen=E5FFE5;DDFFDD;D5FFD5;CCFFCC honeydew=F0FFF0;F0FFF0;F0FFF0;F0FFF0 green M&M=EDF8ED;B7E2B7;81CD82;4BB74C viridianlight=E5FFE6;BEFFBF;96FF97;6EFF70 cobaltgreen=EDF7ED;ACDCAD;6AC06D;3D9140 greenstamp=EFF5F0;BDD5BF;8BB58E;5D9160 shamrock shake=EFF5F0;DBE9DC;C6DCC8;B2D0B4 fraser fir=F0F4F1;B6CAB8;7CA07F;4D6B50 emerald=EFF6F0;BDD8C1;8BBB92;5B9C64 green taxi=EDF8EE;AEDFB5;6FC67C;3F9E4D permanentgreen=E7FEEB;90F9A2;39F55A;0AC92B mint green=E7FEEB;D9FDE0;CBFDD4;BDFCC9 obsidian=F0F5F1;ADC8B3;6B9C75;3D5B43 pool table=EBFAEE;A9E8B6;67D77E;31B94D bottle green=E9FBED;96ECA7;43DD62;1DA237 springgreen=E5FFF2;99FFCC;4DFFA5;00FF7F eton blue=EEF6F0;D1E7D6;B3D7BC;96C8A2 clover=EDF8EF;AEDFB9;6EC783;3EA055 scotland pound=EFF5F1;B2CEBA;75A783;487153 celtics=E5FFED;64FF91;00E241;00611C truegreen=E5FFED;7EFFA4;17FF5B;00AF33 england pound=F1F4F2;C2D0C6;94AB9B;688571 LCD back=F0F5F1;D0DFD5;B1CAB8;91B49C Coke bottle=F0F5F1;C8DBCE;A1C2AB;79A888 vanilla mint=EEF6F1;DBECE0;C7E1D0;B4D7BF old money=EDF7F1;A4D6B4;5AB577;337147 aquaman=EBF9F0;ADE7BF;6FD58F;37BC61 aquamarine=EEF2F7;B7CADC;7FA1C1;4E78A0 shamrock=EFF5F1;AECCB8;6DA37F;40664D pastel green=EEF7F1;CFE9D8;B1DABF;92CCA6 green line=ECF9F0;A5E1BA;5DC983;329555 banker's lamp=E8FDEF;84F3AA;20E966;0E8C3A pumice=F0F5F2;C8DACF;A0BFAC;78A489 green party=EFF6F1;ACCFB9;6AA881;3E6B4F cucumber=EEF7F1;9FD2B3;51AC74;2C5D3F blue fern=F0F4F2;C7D7CD;9EB9A9;759B84 park bench=EEF7F1;A0D3B5;53B079;2E6444 neonavocado=E5FFF0;99FFC2;4DFF94;00FF66 seagreen=E5FFF6;99FFDD;4DFFC3;00FFAA seagreen2=E8FDF1;B4F8D2;81F3B3;4EEE94 emeraldgreen=E5FFF1;87FFBB;28FF85;00C957 seagreen1=E5FFF1;B5FFD5;85FFBA;54FF9F moon=F0F5F2;E9F0EC;E2EBE6;DBE6E0 octopus=ECF8F2;A6DFBF;5FC68D;34925E seagreen3=EBFAF1;B3EBCC;7BDCA6;43CD80 isle royale greenstone=F0F5F2;B0CABD;70A087;426352 fisherman's float=F1F4F2;BFCDC6;8DA79A;607C6E go=EAFAF2;B2EED0;7BE1AE;43D58C starbucks=E5FFF2;66FFB2;00E673;006633 springgreen4=E5FFF2;72FFB8;00FE7E;008B45 springgreen3=E5FFF2;88FFC3;2BFF95;00CD66 springgreen2=E5FFF2;93FFC9;41FF9F;00EE76 mintcream=F5FFFA;F5FFFA;F5FFFA;F5FFFA lampblack=F0F5F2;A5C5B6;5E9179;2E473B fresh green=EAFAF3;BCEFD6;8DE5BA;5EDA9E brushed aluminum=F1F4F2;DDE4E1;CAD5CF;B6C5BE packer green=EEF6F3;9AC8B3;4F9172;213D30 ooze=EEF6F3;ACD5C2;69B391;3E7A5E green visor=EFF5F3;B5D0C4;7BAA95;4D7865 green bark=F1F4F2;BCCBC5;87A297;597368 emeraldgreen2=EAFAF4;A1E9CE;58D9A7;28AE7B mediumspringgreen=E5FFF5;97FFD7;49FFB9;00FA9A bluegrass=F0F5F3;B5CDC5;7AA597;4C7064 aquamarine4=EEF7F4;B0D8CB;73B9A2;458B74 mediumaquamarine=ECF9F4;BFEADC;93DCC3;66CDAA mediumaquamarine3=EAFAF5;ADEBD6;70DCB8;32CD99 mediumaquamarine2=EBFAF5;ADEBD6;6FDCB8;32CC99 aquamarine2=E8FCF6;C2F7E6;9CF3D6;76EEC6 indigo2=EAFAF5;96E5CD;41D1A4;218868 coldgrey=F2F3F2;CCD0CF;A6ADAB;808A87 garden hose=E8FCF6;8AEFD1;2BE3AC;138F6A turquoiseblue=E5FFF7;86FFDB;27FFBF;00C78C blue green algae=EDF7F5;AAD9CD;66BBA5;3B8471 electric turquoise=E8FCF7;B3F6E3;7EEFD0;49E9BD 6 ball=EBFAF6;8DE0CD;34C2A1;1B6453 cooler=EFF6F4;9FCAC1;54998A;284942 turquoise=EBFAFA;D6F5F5;C2EFEF;ADEAEA sign green=E5FFFA;68FFDE;00E9B7;006B54 green ash=F0F4F4;C2D3CF;93B1AB;668E86 greencopper=F0F5F4;B8D1CC;80ADA4;527F76 liberty=EDF8F6;D4EFE9;BCE5DD;A4DCD1 masters jacket=ECF8F6;8BD5C7;3AA18D;174038 emerald city=E9FBF8;9FEFDF;54E2C6;20BF9F light teal=E5FFFA;99FFEB;4DFFDB;00FFCC darkgreencopper=EFF5F4;B3D0CA;77AAA1;4A766E green scrubs=EFF6F5;B6D6D1;7EB7AD;4F8E83 green gables=EEF6F5;ACD3CD;69B0A5;3E766D mediterranean=EEF6F5;ACD3CD;69B0A5;3E766D blue lagoon=EDF8F6;B7E2DB;82CDC0;4CB7A5 aquarium=EBF9F7;A5E6DC;5FD3C0;2FAA96 mint blue=E6FEFA;E2FEF9;DFFEF9;DBFEF8 blue ice=E6F3FE;C0E0FD;9ACEFC;74BBFB malachite=E8FCF9;83F0E0;1FE3C7;108070 atlantic green=EBF9F8;9EE2DA;51CBBD;2A8E82 army uniform=F1F3F3;AEBBBA;6D8280;353F3E pacific green=E9FBF9;AEF0EA;72E6DA;36DBCA wavecrest=EEF7F6;D2E9E7;B5DBD8;99CDC9 natural turquoise=ECF9F8;B4E7E2;7DD5CD;45C3B8 manganeseblue=E6FFFD;7FFDF5;19FBED;03A89E green agate=EFF5F5;B0D0CF;72AAA8;457371 lightseagreen=E9FBFA;9CEDE9;4EDFD7;20B2AA mouthwash=E6FFFE;87FEF8;28FEF3;01C5BB mediumturquoise=EBFAFA;C2F0F0;99E5E5;70DBDB cool mint=E6FFFE;C9FFFD;ADFEFC;90FEFB sea green=E7FEFD;78F9F6;0BF2ED;068481 azure4=F2F3F3;CDD0D0;A8AEAE;838B8B lightcyan4=F1F3F3;CAD0D0;A2AEAE;7A8B8B azure3=F1F4F4;E1E7E7;D1DADA;C1CDCD paleturquoise4=F0F4F4;C1D2D2;93B0B0;668B8B lightcyan3=F0F5F5;DCE8E8;C8DADA;B4CDCD darkslategray=EFF5F5;A4C9C9;5C9A9A;2F4F4F darkslategrey=EFF5F5;A4C9C9;5C9A9A;2F4F4F cadetblue=EFF5F6;BFD8D9;8FBBBD;5F9EA0 lightblue=EBF6F9;D7ECF3;C2E2EC;ADD8E6 darkslategray4=EFF6F6;B8D5D5;80B4B4;528B8B azure2=EFF6F6;EAF3F3;E5F1F1;E0EEEE paleturquoise3=EEF7F7;D0E9E9;B3DBDB;96CDCD sgiteal=EDF8F8;A8DDDD;64C2C2;388E8E darkslategray3=ECF8F8;C6EAEA;9FDBDB;79CDCD lightcyan2=ECF8F8;E3F5F5;DAF1F1;D1EEEE aqua=E5FFFF;99FFFF;4DFFFF;00FFFF paleturquoise=EAFBFB;D6F6F6;C3F2F2;AFEEEE paleturquoise2=EAFBFB;D6F6F6;C2F2F2;AEEEEE darkslategray2=E9FCFC;CAF7F7;ACF3F3;8DEEEE metallic mint=E6FFFF;ACFEFE;71FEFD;37FDFC teal=E5FFFF;6FFFFF;00F7F7;008080 darkcyan=E5FFFF;72FFFF;00FEFE;008B8B cyan3=E5FFFF;88FFFF;2BFFFF;00CDCD cyan2=E5FFFF;93FFFF;41FFFF;00EEEE cyan=E5FFFF;99FFFF;4DFFFF;00FFFF darkslategray1=E5FFFF;CBFFFF;B1FFFF;97FFFF paleturquoise1=E5FFFF;D7FFFF;C9FFFF;BBFFFF lightcyan=E5FFFF;E4FFFF;E2FFFF;E0FFFF azure=F0FFFF;F0FFFF;F0FFFF;F0FFFF darkturquoise=EBF0FA;C2D1F0;99B2E5;7093DB turquoise4=E5FEFF;72FAFF;00F5FE;00868B turquoise3=E5FEFF;88FAFF;2BF7FF;00C5CD turquoise2=E5FEFF;93FBFF;41F8FF;00E5EE turquoise1=E5FEFF;99FBFF;4DF8FF;00F5FF swimming pool=E8FBFC;BDF4F7;92EDF1;67E6EC fenway monster=EFF5F5;B3CFD1;77A9AD;4A777A teal LED=E5FDFF;9BF8FF;50F2FF;05EDFF cadetblue4=EFF5F5;B8D2D5;81B0B4;53868B old copper=EEF6F6;C5DFE1;9CC8CC;73B1B7 indiglo=E5FDFF;9BF6FF;50F0FF;05E9FF cadetblue3=ECF7F8;C6E6EA;A0D6DB;7AC5CD cadetblue2=E9FAFC;CBF3F7;ACECF3;8EE5EE cerulean=E6FCFE;8CF1FC;33E6FA;05B8CC cadetblue1=E5FDFF;CCFAFF;B2F8FF;98F5FF powderblue=ECF7F9;D8F0F3;C4E8EC;B0E0E6 pastel blue=E9FAFC;DBF6FA;CEF3F8;C1F0F6 nypd blue=EBF8FA;AFE2EB;74CDDC;39B7CD lindsay eyes=F0F4F5;C1D3D7;93B1B8;65909A diamond blue=E7F9FE;9CE7F9;52D5F5;0EBFE9 robin's egg=EBF6F9;DEF0F5;D0EAF1;C3E4ED lightblue4=F0F3F4;C2CED2;94A9AF;68838B surf=E7F8FD;BBEBFA;8FDEF7;63D1F4 lightblue3=EEF4F7;D2E3E9;B6D1DB;9AC0CD lake michigan=ECF5F8;B8DBE6;84C0D4;50A6C2 lightblue2=EAF6FA;D7EFF6;C5E7F2;B2DFEE deepskyblue4=E5F9FF;72DCFF;00BEFE;00688B deepskyblue3=E5F9FF;88E1FF;2BCAFF;009ACD skyblue5=E5F9FF;88E1FF;2ACAFF;0099CC deepskyblue2=E5F9FF;93E4FF;41CFFF;00B2EE deepskyblue=E5F9FF;99E5FF;4DD2FF;00BFFF lightblue1=E5F9FF;D9F5FF;CCF2FF;BFEFFF peacock=EBF6FA;ADDAEA;6FBEDA;33A1C9 LCD dark=EFF4F5;B7CCD4;7EA4B2;507786 skyblue=E9F6FB;C8E9F6;A8DBF0;87CEEB summersky=E9F6FB;AEDFF2;73C7E8;38B0DE police strobe=E5F7FF;9DE1FF;54CBFF;0BB5FF caribbean=E6F7FE;AFE4FD;79D2FC;42C0FB blue shark=EFF3F6;C2D4DE;96B5C5;6996AD carolina blue=ECF4F8;B9D7E6;86BAD4;539DC2 steelblue=EDF3F8;B4CDE2;7CA8CC;4682B4 skyblue6=EBF5FA;ADD6EB;6FB8DC;3299CC topaz=E6F7FF;90DAFF;3ABEFE;0198E1 blue line=E9F5FB;ACD9F2;70BDE8;33A1DE lightskyblue4=F0F3F5;BFCBD3;8EA4B1;607B8B pacific blue=EEF3F7;A6C3D3;5D92B0;35586C blue sponge=EEF3F7;BED3DF;8DB2C8;5D92B1 lightskyblue3=EDF4F7;CDDFE9;ADCBDB;8DB6CD liz eyes=EDF4F7;A3C4D7;5995B7;325C74 lightskyblue2=EAF5FB;D2E9F7;BBDEF2;A4D3EE blue mist=E6F5FF;C5E9FE;A3DCFE;82CFFD neon blue=E5F6FF;BBE7FF;91D7FF;67C8FF lightskyblue1=E5F6FF;D4EFFF;C2E9FF;B0E2FF lightskyblue=E7F5FE;C7E8FD;A7DBFB;87CEFA skyblue3=ECF3F9;C1DAEA;97C0DC;6CA6CD skyblue4=EEF3F6;B3C8D7;789DB7;4A708B cerulean blue=EBF3F9;D0E4F2;B6D4EA;9BC4E2 skyblue2=E8F4FC;C5E3F7;A1D1F3;7EC0EE skyblue1=E5F5FF;C6E8FF;A6DBFF;87CEFF malta blue=EFF3F6;B7C9D8;80A0B9;517693 lake huron=EFF3F5;BDCBD6;8CA3B6;5D7B93 blue whale=EEF3F6;AEC4D5;6E95B4;42647F steelblue3=EBF3F9;B7D3EB;83B4DC;4F94CD steelblue2=E8F3FD;B9DBF8;8BC4F3;5CACEE steelblue1=E5F3FF;BAE0FF;8FCCFF;63B8FF blue dog=F1F2F4;B9C0C7;828E9A;525C65 steelblue4=EDF3F8;A7C4DD;6195C1;36648B tropical blue=E7F3FE;BBDDFB;8EC7F9;62B1F6 aliceblue=F0F8FF;F0F8FF;F0F8FF;F0F8FF slategrey=F1F2F4;C6CCD3;9BA6B1;708090 slategray=F1F2F4;C6CCD3;9BA6B1;708090 lightslategrey=F0F2F4;C8CFD6;9FABB7;778899 lightslategray=F0F2F4;C8CFD6;9FABB7;778899 lake erie=EFF2F6;BFCDDB;90A8C1;6183A6 slategray3=EEF2F6;D4DEE9;B9CADB;9FB6CD sgilightblue=EEF2F7;C8D6E4;A3BAD2;7D9EC0 dodgerblue4=E8F2FC;86BCF1;2385E6;104E8B dodgerblue3=E8F2FC;9CC8F3;509EEA;1874CD dodgerblue2=E7F2FD;A4CEF8;60AAF3;1C86EE la maison bleue=E6F2FF;B9DCFF;8DC5FE;60AFFE slateblue=EDEBF9;C2BBEA;968ADC;6A5ACD dodgerblue=E5F2FF;A3D2FF;60B1FF;1E90FF slategray4=F1F2F4;C4CAD1;98A3AF;6C7B8B heather blue=F0F2F5;DDE2E9;CAD3DC;B7C3D0 seurat blue=EDF2F8;C4D5E7;9CB7D6;739AC5 blueberry=ECF2F9;C4D7EB;9DBCDE;75A1D0 slategray2=EAF2FA;DAE8F6;C9DDF2;B9D3EE blue bucket=E7F2FE;B2D6FB;7EB9F8;499DF5 slategray1=E5F2FF;DBEDFF;D0E7FF;C6E2FF greek roof=ECF2F8;ACC4E0;6B97C8;3B6AA0 picasso blue=E6F1FF;9AC8FE;4E9FFE;0276FD sign blue=E5F1FF;71B3FF;0075FB;003F87 lightsteelblue4=F1F2F4;C5CAD1;99A3AE;6E7B8B lake superior=EFF2F6;B7C4D4;7E96B3;506987 lightsteelblue3=EEF2F6;D5DEE8;BBC9DB;A2B5CD denim=EDF2F8;B2C7E0;769CC9;4372AA blue spider=ECF2F8;99B7DB;457CBE;26466D peafowl=E7F1FE;A4CAFA;60A3F6;1D7CF2 blue tuna=F0F2F5;C3CBD5;95A3B6;687C97 blue corn=EFF2F5;A8B6C8;617A99;344152 blue stone=EEF2F6;B8C7DB;819CC0;50729F blue bird=EDF2F7;B5C7DF;7D9DC7;4973AB lightsteelblue=EFEFF5;CFCFE2;AFAFCF;8F8FBC mailbox=EBF1F9;A5C1E5;5F90D0;3063A5 lightsteelblue2=EBF1FA;DBE7F6;CCDCF2;BCD2EE forget me nots=E5F1FF;C3DDFF;A0CAFF;7EB6FF lightsteelblue1=E5F1FF;DCEBFF;D3E6FF;CAE1FF lake ontario=EEF2F7;B6C6DD;7F9BC3;4D71A3 blue angels=ECF1F9;9EB9DF;5081C5;2B4F81 blue ridge mtns=EBF1FA;B5CCEB;7FA6DD;4981CE blue cow=EBF1FA;CADAF1;A9C3E9;88ACE0 chemical suit=E9F1FC;B9D1F4;89B2ED;5993E5 big blue bus=ECF1F8;ACC2E2;6C92CC;3A66A7 parrot=E9F1FB;ADC9F1;71A1E6;3579DC blue pill=E8F0FD;B6D0F7;83B0F2;5190ED blue jeans=EFF2F5;AFBBCE;6F84A7;42526C pollock blue=EDF1F7;B7C5DF;819AC7;4D6FAC st louis blues=EBF0F9;A1B8E3;567FCE;2C5197 cornflowerblue=EFEFF5;AFAFCF;6E6EA9;42426F neptune=E8EFFD;BFD3F9;96B7F5;6D9BF1 natural gas=E7EFFE;B8CFFB;8AB0F9;5B90F6 ulysses butterfly=E7EFFE;A0C1FB;5A92F7;1464F4 blue train=EDF0F8;AABBDE;6786C4;3A5894 alaska sky=EAEFFB;91ADEA;386BD8;1B3F8B ty nant=E6EDFF;98B5FF;4B7DFE;0147FA cobalt=E5E5FF;BBBBFF;9090FF;6666FF royalblue4=EBEFF9;9BADE3;4C6CCD;27408B royalblue3=EBEEFA;B0BFEB;758FDC;3A5FCD royalblue=E5E5FF;AAAAFF;6F6FFF;3333FF royalblue2=E8EDFD;B1C3F8;7A98F3;436EEE cichlid=E5ECFF;99B2FF;4D78FF;003EFF royalblue1=E5ECFF;B1C5FF;7C9DFF;4876FF aluminum=F1F2F3;D9DADF;C1C3CA;A9ACB6 delft=ECEEF9;95A4DE;3E59C2;22316C blue grapes=EDEFF8;AAB3DC;6876C1;3B4990 pabst blue=EBEEF9;9DA9E4;4E64CE;283A90 dolphin=F1F1F3;C5C7CF;9A9CAA;6F7285 nikko blue=EBEDFA;C8CDF0;A6AEE7;838EDE silver=EAEBFB;E8EAFA;E7E9FA;E6E8FA blue nile=F1F1F3;CACBD4;A4A5B4;7D7F94 stained glass=E6E7FF;A8ACFF;6B72FE;2E37FE midnightblue=E5E5FF;5555FF;0000C3;000033 richblue=EEEEF6;BCBCDD;8B8BC4;5959AB sgislate blue=EDEDF8;C4C4E7;9A9AD7;7171C6 quartz=ECECF9;E5E5F7;DFDFF5;D9D9F3 navyblue=EBEBFA;9898E6;4646D1;23238E mediumblue=E5E5FF;8888FF;2B2BFF;0000CD lavender=F7EEF7;E8D2E8;DAB5DA;CC99CC navy=E5E5FF;6F6FFF;0000F7;000080 darkblue=E5E5FF;7272FF;0000FE;00008B newmidnightblue=E5E5FF;7878FF;0B0BFF;00009C blue2=E5E5FF;9393FF;4141FF;0000EE blue=E5E5FF;9999FF;4D4DFF;0000FF neonblue=E5E5FF;B3B3FF;8080FF;4D4DFF periwinkle=E5E5FF;D2D2FF;BEBEFF;AAAAFF offwhiteblue=E5E5FF;DDDDFF;D5D5FF;CCCCFF ghostwhite=F8F8FF;F8F8FF;F8F8FF;F8F8FF curacao=EDEDF8;BCBCE3;8C8ACF;5B59BA ultramarine=E8E7FD;8780F6;2619EF;120A8F presidential blue=EFEEF6;A59FCE;5D53A3;302B54 darkslateblue=F5EBFA;CC98E6;A446D1;6B238E slateblue4=EFEDF7;B1ABDB;7468BE;473C8B dress blue=EEEDF8;AAA2D9;6558BB;3B3178 slateblue3=EDEBF9;C1BBEA;958ADC;6959CD slateblue2=EBE8FC;C5BDF8;A092F3;7A67EE lightslateblue=E9E5FF;C7BEFF;A697FF;8470FF slateblue1=E9E5FF;C7BEFF;A597FF;836FFF mediumslateblue=EBE8FC;C6BDF8;A093F3;7B68EE cornflower=EBE5FF;AD99FF;704DFF;3300FF mediumpurple4=F1EEF6;BEB2D7;8B75B9;5D478B mediumpurple2=EFE8FC;D4C3F7;BA9EF3;9F79EE mediumpurple3=F0ECF9;CEC0EA;AB94DC;8968CD mediumpurple=F0EBFA;D1C2F0;B299E5;9370DB mediumpurple1=EEE5FF;D8C4FF;C1A3FF;AB82FF blue safe=F0E5FF;C299FF;944DFF;6600FF blue deep=F1E6FE;B171FA;7108E9;380474 indigo=F4E5FF;C26FFF;8F00F8;4B0082 mediumslateblue2=F2E5FF;CC99FF;A54DFF;7F00FF purple4=F3EAFB;BF90EA;8B36D9;551A8B purple3=F3E9FB;CCA6EE;A462E2;7D26CD blueviolet=F5EFF5;D9BFD9;BC8FBC;9F5F9F purple2=F3E7FD;D2A9F8;B26AF3;912CEE purple1=F3E5FF;D5A9FF;B86DFF;9B30FF garden plum=F2F1F4;C7C0CD;9C90A7;71637D purple rain=F3EEF7;C5B0D8;9871B9;694489 violet flower=F5E5FF;E3B9FF;D18CFF;BF5FFF purple=FFE5FF;FF6FFF;F700F7;800080 indigo tile=F3F0F5;C9BBD0;9F86AB;72587F darkorchid4=F5EBFA;CB97E6;A244D1;68228B darkorchid=F5EAFA;D6ADEB;B870DC;9932CD darkorchid3=F5EAFA;D7ADEB;B870DC;9A32CD darkorchid2=F6E8FD;DFAEF8;C974F3;B23AEE concord grape=F7E6FF;D278FE;AD0AFD;660198 purple6=F6E5FF;DD99FF;C34DFF;AA00FF darkorchid1=F7E5FF;E4AEFF;D276FF;BF3EFF wild violet=F6E7FE;D58DF8;B533F3;820BBB darkviolet=F7E5FF;DC8AFF;C12FFF;9400D3 zincwhite=FDF8FF;FDF8FF;FDF8FF;FDF8FF ultramarineviolet=F6ECF9;CC97DD;A242C1;5C246E mediumorchid4=F6EDF8;D2A7DC;AE62C1;7A378B mediumorchid3=F6EBF9;E0B8EB;CA85DC;B452CD mediumorchid=F7EBFA;E3B9ED;CE87E0;BA55D3 mediumorchid2=F8E8FD;EBBAF8;DE8DF3;D15FEE grape=F5F0F3;C6ACBA;986782;543948 mediumorchid1=FAE5FF;F1BBFF;E990FF;E066FF eggplant=F3F0F4;CEC1D1;A892AD;816687 violet=FCE9FC;F7C6F7;F3A4F3;EE82EE cobaltvioletdeep=F9EAFB;E199EA;CA48D9;91219E lavender field=F5EFF5;CEB5D0;A77AAB;754C78 turnip=F7EDF7;DDB7DF;C380C6;A74CAB thistle4=F3F1F3;D0CAD0;AEA2AE;8B7B8B plum4=F4F0F4;D2C1D2;B093B0;8B668B thistle3=F5F0F5;E7DCE7;DAC9DA;CDB5CD thistle=F7EDF5;E1B9D7;CB84BA;B5509C plum3=F7EEF7;E9D0E9;DBB3DB;CD96CD sgibeet=F8EDF8;DDA8DD;C264C2;8E388E thistle2=F8ECF8;F5E4F5;F1DBF1;EED2EE plum=F8ECF8;EFD3EF;E6B9E6;DDA0DD corfu pink=F8ECF8;F4E0F4;F0D4F0;ECC8EC plum2=FBEAFB;F6D6F6;F2C2F2;EEAEEE orchid=FAEBF9;EFC2ED;E599E2;DA70D6 darkmagenta=FFE5FF;FF72FF;FE00FE;8B008B truepurple=FFE5FF;FF77FF;FF09FF;990099 magenta3=FFE5FF;FF88FF;FF2BFF;CD00CD magenta2=FFE5FF;FF93FF;FF41FF;EE00EE fuchsia=FFE5FF;FF99FF;FF4DFF;FF00FF magenta=FFE5FF;FF99FF;FF4DFF;FF00FF plum1=FFE5FF;FFD7FF;FFC9FF;FFBBFF thistle1=FFE5FF;FFE4FF;FFE2FF;FFE1FF orchid4=F6EEF6;D7B2D6;B975B7;8B4789 orchid3=F9ECF8;EAC0E8;DC95D9;CD69C9 orchid1=FFE5FE;FFC5FD;FFA4FB;FF83FA orchid2=FCE8FB;F7C4F5;F39FEF;EE7AE9 purple ink=F5F0F4;D7C3D6;BA97B7;9C6B98 darkpurple=FAEAF8;E694DB;D33EBD;871F78 pink glass=F5F0F4;E9DFE8;DECFDB;D3BECF purple fish=F6EFF5;DFC5DA;C99CC0;B272A6 blue corn chips=F3F1F3;C1B9C0;8F818C;584E56 rose=FFE5FA;FF99EB;FF4DDB;FF00CC sea urchin=F6EFF4;CFAAC7;A9659A;683A5E maroon6=FAEBF5;E698CC;D146A4;8E236B violetred=FCE9F5;F1A2D4;E65CB4;D02090 harold's crayon=FBE9F5;EE9DD3;E050B0;B62084 fuchsia2=FFE5F6;FF99DD;FF4DC3;FF00AA spicypink=FFE5F6;FFA2DE;FF5FC6;FF1CAE maroon4=FBEAF4;E992C9;D73A9D;8B1C62 maroon3=FBEAF4;EEA7D3;E065B2;CD2990 mediumvioletred=FDE8F5;F498D2;EC48AF;C71585 maroon2=FDE7F5;F8AADB;F36DC1;EE30A7 maroon1=FFE5F5;FFAADF;FF6FC9;FF34B3 neonpink=FFE5F5;FFBEE6;FF96D6;FF6EC7 dog tongue=FDE8F4;FAD1EA;F8BBDF;F6A4D5 cotton candy=FDE8F4;FBD6EB;F9C5E3;F7B3DA barney=FBEAF3;EEACD1;E16FAE;D4318C deeppink4=FDE7F3;F67FBF;EE178C;8B0A50 deeppink3=FDE7F3;F796CA;F044A1;CD1076 deeppink2=FDE7F3;F8A0D0;F359AC;EE1289 deeppink=FFE5F3;FFA0D3;FF5AB3;FF1493 amethyst=F5F0F2;D8C3CE;BA97A9;9D6B84 hotpink4=F7EDF2;DBA9C2;BF6692;8B3A62 raspberry=F9EBF2;E39ABF;CC498B;872657 carnation=FAEBF2;F0C9DC;E7A7C7;DE85B1 deeppurple=FBEAF2;E77EB3;C12474;551033 hotpink=FFE5F2;FFBCDE;FF92C9;FF69B4 hotpink1=FFE5F2;FFBEDD;FF96C9;FF6EB4 20 pound=F6EFF2;DAC1CD;BF93A7;A46582 hotpink2=FCE8F1;F8BED9;F394C0;EE6AA7 cranberry=FAEBF1;E8A8C4;D66697;B6316C violetred4=FAEBF2;E697BB;D14484;8B2252 violetred3=FAEAF1;EBADC9;DC70A0;CD3278 violetred2=FDE8F1;F8AED0;F374AE;EE3A8C violetred1=FFE5F1;FFAED3;FF76B4;FF3E96 hotpink3=F9ECF1;EABDD1;DC8FB0;CD6090 plum pudding=F9ECF1;E09DBA;C84F82;862A51 broadwaypink=FFE5F0;FF99C2;FF4D94;FF0066 lavenderblush4=F3F2F2;D0CDCE;AEA8AA;8B8386 pink jeep=FBE9F0;F2B1CA;E97AA5;E0427F bubble gum=FFE5EF;FFCADE;FFAECC;FF92BB smyrna purple=F6EFF1;DAC0CA;BE91A2;A2627A maroonb0=FAEBF0;E7A7BF;D4638D;B03060 lavenderblush2=F6EFF1;F3EAED;F1E5E9;EEE0E5 lavenderblush3=F4F1F2;E7E1E3;DAD1D4;CDC1C5 palevioletred3=F9ECF0;EAC0CE;DC94AB;CD6889 palevioletred=FAEBF0;F0C2D1;E599B2;DB7093 pink shell=FBE9EF;F9E0E8;F8D6E1;F6CCDA palevioletred1=FFE5EE;FFC4D8;FFA3C1;FF82AB lavenderblush=FFF0F5;FFF0F5;FFF0F5;FFF0F5 palevioletred4=F6EEF1;D7B2BE;B9758B;8B475D palevioletred2=FCE8EF;F7C3D4;F39EBA;EE799F bunny eye=F8EDF0;DFB1BD;C7758A;A5435C pink4=F4F0F1;D2C0C4;B09097;8B636C pink3=F7EDF0;E9CFD4;DBB0B9;CD919E pink2=FBEAED;F7D4DC;F2BFCA;EEA9B8 pink1=FFE5EB;FFD5DE;FFC5D2;FFB5C5 crimson=FDE8EC;F69DAF;EF5272;DC143C cranberry jello=FEE7EC;FBB4C2;F88099;F54D70 bright red=FFE5EB;FF99AD;FF4D70;FF0033 pink cloud=FDE8EC;FAD3DA;F8BDC8;F6A8B6 permanent redviolet=FBE9EC;F1A8B5;E6677D;DB2645 pink=FFE5EA;FFD9E0;FFCCD5;FFC0CB tongue=FAEBED;F4D1D6;EDB8C0;E79EA9 lightpink2=FBE9EC;F7D2D7;F2BAC2;EEA2AD bordeaux=FCE9EC;EE909F;E03852;99182C geraniumlake=FDE7EA;F79DAA;F1536A;E31230 lightpink=FFE5E9;FFD6DC;FFC6CE;FFB6C1 lightpink4=F5F0F1;D3BEC1;B18D92;8B5F65 lightpink3=F7EDEF;E9CDD1;DBACB3;CD8C95 ham=F8ECEE;EED2D6;E5B8BE;DB9EA6 lightpink1=FFE5E9;FFD3D9;FFC0C9;FFAEB9 apple=F9EBED;EAB7BD;DB828C;CC4E5C ruby red=FBE9EB;EEA4AC;E15E6C;C82536 sign red=FBE9EB;EE9AA2;E04A5A;AF1E2D alizarincrimson=FCE8EA;F4A8AE;EB6772;E32636 bermuda sand=FBE9EA;FADEE0;F8D4D6;F6C9CC cherry=FCE8E9;F6BABE;F18C92;EB5E66 conch=F6EFEF;E9D7D8;DDC0C1;D0A9AA venetianred=FCE8E9;F39FA1;EA565A;D41A1F cadmiumredlight=FFE5E7;FF9A9E;FF4F56;FF030D madderlakedeep=FCE9E9;F4AAAB;EB6C6E;E32E30 rosemadder=FCE9E9;F4ADAE;EB7273;E33638 burgundy=FEE6E7;FB7E81;F8171B;9E0508 hematite=FBE9E9;F3B6B7;EB8484;E35152 ATartan.au3: expandcollapse popup;=================================================== ; ATartan by Valery Ivanov, 30 March 2010 ;=================================================== ; History ; 1 April: ; - Parts of tartan code can be delimited by space " " (or "," ) ; - More short source ; - New color ("K" means Black) ; - Tartan can use Gy as Gray (used to D) and Bk as Black (used to K) ; - Strip double (or more) spaces between words, leading and trailing white spaces! ; 16 April: ; - New methods (image templates) to improve speed and quality ; 21 April: ; Added ; - start by {Enter} key ; - color layout #include <GDIPlus.au3> #include <GuiConstantsEx.au3> #include <ScreenCapture.au3> #include <Misc.au3> #include <WinAPI.au3> Opt('MustDeclareVars', 1) ; Global $vDLL_user32 ; Normal Thread Global $EllipseThread = True ; Silk or metalic thread ;Global $EllipseThread = False Global $YellowFront = 0xFFECDC00, $YellowBack = 0xFFD4B300 Global $BlueFront = 0xFF3C9CE0, $BlueBack = 0xFF08419C Global $RedFront = 0xFFE03C9C, $RedBack = 0xFF9C0841 Global $GreenFront = 0xFF3CE09C, $GreenBack = 0xFF089C41 Global $GrayFront = 0xFFC8C8C8, $GrayBack = 0xFF8E8E8E Global $WhiteFront = 0xFFFFFFFF, $WhiteBack = 0xFFC8C8C8 Global $BlackFront = 0xFF404040, $BlackBack = 0xFF000000 ;Set color layout by it's real name SetColorLayout("Yellow","olive") SetColorLayout("Blue","seagreen") SetColorLayout("Red","darkred") SetColorLayout("Green","kakapo") SetColorLayout("Gray","green quartz") SetColorLayout("White","paleturquoise1") SetColorLayout("Black","army uniform") Global $FrontColor_Yellow = $YellowFront, $BackColor_Yellow = $YellowBack Global $FrontColor_Blue = $BlueFront, $BackColor_Blue = $BlueBack Global $FrontColor_Gray = $GrayFront, $BackColor_Gray = $GrayBack Global $FrontColor_Red = $RedFront, $BackColor_Red = $RedBack Global $FrontColor_Green = $GreenFront, $BackColor_Green = $GreenBack Global $FrontColor_White = $WhiteFront, $BackColor_White = $WhiteBack Global $FrontColor_Black = $BlackFront, $BackColor_Black = $BlackBack ;Tartan description Global $ColorFullNames = StringSplit("Yellow,Blue,Gray,Red,Green,White,Black",",") Global $ColorShortNames = StringSplit("Y,B,D,R,G,W,K",",") ;Global $TartanShortCode = "Gr12 D4 B12 D4 G12 D4 Gr12 W4 Gr12 D4 G12" Global $TartanShortCode = "G1 R29 B18 Bk2 G15 W3 G15 Y3" Global $TartanShortSet = StringSplit($TartanShortCode,",") ;Middle strip is skipped Global $Tartan_count = 2*$TartanShortSet[0]-1 Global $hBrushFront, $hBrushBack Global $Zoom = 1.0, $Size = Round(90/$Zoom) Global $nHeight = Round(50/$Zoom), $nWidth = Round(50/$Zoom) Global $hCloneV, $hCloneH Global $hGUI Global $RedrawButton, $SaveButton, $ZoomButton, $Pic, $hPic, $Msg Global $CodeLabel, $CreateButton Global $hBitmap1, $hImage1 Global $hBmpSource, $hImageSource Global $hGraphic Global $FileSaved = @ScriptDir & "\Tartan_tmp.jpg" Global $Caption = "ATartan © Valery Ivanov, 30 March 2010" $vDLL_user32 = DllOpen("user32.dll") ; Create GUI $hGUI = GUICreate($Caption, 900, 800) GUICtrlCreateGroup("Actions:", 10, 10, 170, 780) GUICtrlSetFont(-1, 10, 800, 0, "Verdana") $RedrawButton = GUICtrlCreateButton("Recreate", 40, 40, 110, 20) GUICtrlSetFont(-1, 10, 800, 0, "Verdana") $ZoomButton = GUICtrlCreateButton("Zoom", 40, 70, 110, 20) GUICtrlSetFont(-1, 10, 800, 0, "Verdana") $SaveButton = GUICtrlCreateButton("Save", 40, 100, 110, 20) GUICtrlSetFont(-1, 10, 800, 0, "Verdana") GUICtrlCreateGroup("Code:", 185, 10, 710, 55) GUICtrlSetFont(-1, 10, 800, 0, "Verdana") $CodeLabel = GUICtrlCreateInput($TartanShortCode, 200, 40, 500, 20) GUICtrlSetFont(-1, 10, 800, 0, "Verdana") $CreateButton = GUICtrlCreateButton("Create", 720, 40, 110, 20) GUICtrlSetFont(-1, 10, 800, 0, "Verdana") GUICtrlCreateGroup("Tartan:", 185, 75, 710, 720) GUICtrlSetFont(-1, 10, 800, 0, "Verdana") If FileExists($FileSaved) then $Pic = GUICtrlCreatePic($FileSaved, 190, 90, 700, 700) else $Pic = GUICtrlCreatePic("", 190, 90, 700, 700) endif GUISetState() ; Initialize GDI+ library _GDIPlus_Startup() ; Capture client area $hPic = ControlGetHandle($Caption, "", "Static1") ; Make there bitmap, image and graphics $hBitmap1 = _ScreenCapture_CaptureWnd("", $hPic) $hImage1 = _GDIPlus_BitmapCreateFromHBITMAP($hBitmap1) $hGraphic = _GDIPlus_ImageGetGraphicsContext($hImage1) CreateBrushes() TartanParse() CreateColorElements($hGraphic) If Not FileExists($FileSaved) then DrawPlaid($hGraphic) While 1 $Msg = GUIGetMsg() switch $Msg case $GUI_EVENT_CLOSE ExitLoop case $CreateButton TartanParse() DrawPlaid($hGraphic) case $RedrawButton DrawPlaid($hGraphic) case $SaveButton SaveTartan() case $ZoomButton $Zoom /= 2 if $Zoom < 0.25 then $Zoom = 2 DrawPlaid($hGraphic) endswitch if WinActive($hGUI,"") and _IsPressed("0D",$vDLL_user32) then TartanParse() DrawPlaid($hGraphic) endif WEnd ; Clean up resources DisposeColorElements() DisposeBrushes() _GDIPlus_ImageDispose($hImage1) _WinAPI_DeleteObject($hBitmap1) ; Shut down GDI+ library _GDIPlus_Shutdown() DllClose($vDLL_user32) ;===================================== ; Save Tartan Image func SaveTartan() local $FileName $FileName = FileSaveDialog( "Choose a name.", @ScriptDir, "Image file (*.jpg)", 16, "Tartan.jpg") if @error then MsgBox(4096,"","Save cancelled.") else FileCopy($FileSaved, $FileName, 1) endif endfunc ;===================================== ; Create Brushes func CreateBrushes() local $Col for $i = 1 to $ColorFullNames[0] $Col = $ColorFullNames[$i] Assign("hBrushFront_" & $Col,_GDIPlus_BrushCreateSolid (Eval("FrontColor_" & $Col)),2) Assign("hBrushBack_" & $Col,_GDIPlus_BrushCreateSolid (Eval("BackColor_" & $Col)),2) next endfunc ;===================================== ; Dispose Brushes func DisposeBrushes() local $Col for $i = 1 to $ColorFullNames[0] $Col = $ColorFullNames[$i] _GDIPlus_BrushDispose (Eval("hBrushFront_" & $Col)) _GDIPlus_BrushDispose (Eval("hBrushBack_" & $Col)) next endfunc ;===================================== ; Create ColorElements func CreateColorElements($hG) local $Color if Eval("hCloneV_White") then DisposeColorElements() for $i = 1 to $ColorFullNames[0] $Color = $ColorFullNames[$i] Create_VCells($hG,$Color,$Zoom) Create_HCells($hG,$Color,$Zoom) next endfunc ;===================================== ; Dispose ColorElements func DisposeColorElements() local $Col for $i = 1 to $ColorFullNames[0] $Col = $ColorFullNames[$i] _GDIPlus_ImageDispose(Eval("hCloneV_" & $Col)) _GDIPlus_ImageDispose(Eval("hCloneH_" & $Col)) next endfunc ;===================================== ; Create Vertical Cells func Create_VCells($hG,$Color,$Zoom) local $hBrushFront, $hBrushBack _GDIPlus_GraphicsClear ($hG,0xFFFFFFFF) $hBrushFront = Eval("hBrushFront_" & $Color) $hBrushBack = Eval("hBrushBack_" & $Color) _GDIPlus_GraphicsFillRect($hG, 0,0, 8, 16, $hBrushBack) if $EllipseThread then _GDIPlus_GraphicsFillEllipse($hG, 0,0, 7, 15, $hBrushFront) else _GDIPlus_GraphicsFillRect($hG, 0,0, 7, 15, $hBrushFront) endif Assign("hCloneV_" & $Color, _GDIPlus_BitmapCloneArea ($hImage1, 0, 0, 8, 16, $GDIP_PXF24RGB),2) endfunc ;===================================== ; Create Horizontal Cells func Create_HCells($hG,$Color,$Zoom) local $hBrushFront, $hBrushBack _GDIPlus_GraphicsClear ($hG,0xFFFFFFFF) $hBrushFront = Eval("hBrushFront_" & $Color) $hBrushBack = Eval("hBrushBack_" & $Color) _GDIPlus_GraphicsFillRect($hG, 0,0, 16, 8, $hBrushBack) if $EllipseThread then _GDIPlus_GraphicsFillEllipse($hG, 1,0, 15, 7, $hBrushFront) else _GDIPlus_GraphicsFillRect($hG, 1,0, 15, 7, $hBrushFront) endif Assign("hCloneH_" & $Color, _GDIPlus_BitmapCloneArea ($hImage1, 0, 0, 16, 8, $GDIP_PXF24RGB),2) endfunc ;===================================== ; Draw Plaid func DrawPlaid($hG) local $PosMax, $NStrip = 1, $CurColor Local $Step = 0, $iStep = 0 _GDIPlus_GraphicsClear ($hG,0xFFFFFFFF) GUICtrlSetImage ($Pic, $FileSaved) $Size = Round(90/$Zoom) $nHeight = Round(50/$Zoom) $nWidth = Round(50/$Zoom) $PosMax = $Tartan_Width_1 - 1 $CurColor = $Tartan_Color_1 $NStrip = 1 ProgressOn("ATartan progress", "Working...", "0 percent") for $i = 0 to $Size $Step += 1 if $Step = Round($Size/100) then $iStep += 1 ProgressSet( $iStep, $iStep & " percent") $Step = 0 endif if $i > $PosMax then $NStrip += 1 if $NStrip > $Tartan_count then $CurColor = "White" else $PosMax += Eval("Tartan_Width_" & $NStrip) $CurColor = Eval("Tartan_Color_" & $NStrip) endif endif Create_Ver_Thread($hG,$i,$CurColor) Create_Hor_Thread($hG,$i,$CurColor) next ProgressSet(100 , "Done", "Complete") sleep(500) ProgressOff() _GDIPlus_ImageSaveToFile($hImage1, $FileSaved) GUICtrlSetImage ($Pic, $FileSaved) endfunc ;===================================== ; Draw Vertical Thread func Create_Ver_Thread($hG,$nCol,$Color) local $iX, $iYStart, $iY, $i $iX = +8*$Zoom*($nCol-1) $iYStart = -8*$Zoom*($nCol-1) for $i = -$nHeight to $nHeight $iY = $iYStart+32*$Zoom*$i if $iX >= -9*$Zoom and $iY >= -13*$Zoom then _GDIPlus_GraphicsDrawImageRectRect ($hG, Eval("hCloneV_"& $Color), 0, 0, 8, 16, $iX,$iY, 8*$Zoom, 16*$Zoom) endif next endfunc ;===================================== ; Draw Horizontal Thread func Create_Hor_Thread($hG,$nRow,$Color) local $iX, $iY, $iXStart, $i $iXStart = 8*$Zoom-8*$Zoom*($nRow-1) $iY = 8*$Zoom+8*$Zoom*($nRow-1) for $i = -$nWidth to $nWidth $iX = $iXStart+32*$Zoom*$i if $iX >= -25*$Zoom and $iY >= -9*$Zoom then _GDIPlus_GraphicsDrawImageRectRect ($hGraphic, Eval("hCloneH_"&$Color), 0, 0, 16, 8, $iX,$iY, 16*$Zoom, 8*$Zoom) endif next endfunc ;===================================== ; Parse Tartan Code func TartanParse() local $TCode, $TSet, $Color, $Width $TartanShortCode = StringStripWS(GUICtrlRead($CodeLabel),7) $TartanShortCode = StringReplace($TartanShortCode,"Bk", "K") $TartanShortCode = StringReplace($TartanShortCode,"Gy", "D") $TSet = StringSplit($TartanShortCode,", ") $Tartan_count = 2*$TSet[0]-1 For $i = 1 To $TSet[0]-1 $Color = ColorName(StringLeft($TSet[$i],1)) $Width = StringTrimLeft($TSet[$i],1) Assign("Tartan_Color_" & $i,$Color,2) Assign("Tartan_Width_" & $i,$Width,2) Assign("Tartan_Color_" & $Tartan_count+1-$i,$Color,2) Assign("Tartan_Width_" & $Tartan_count+1-$i,$Width,2) next $Color = ColorName(StringLeft($TSet[$TSet[0]],1)) $Width = StringTrimLeft($TSet[$TSet[0]],1) Assign("Tartan_Color_" & $TSet[0],$Color,2) Assign("Tartan_Width_" & $TSet[0],$Width,2) endfunc ;===================================== ; Get full name of color by it's short name func ColorName($ColorShortName) local $DefaultColorName = "White" For $i = 1 To $ColorFullNames[0] if $ColorShortName = $ColorShortNames[$i] then return $ColorFullNames[$i] next return $DefaultColorName endfunc ;===================================== ; Set color layout by it's name func SetColorLayout($TartanColor,$ColorName) local $Shades $Shades = IniRead("CShades.ini", "CShades", $ColorName,"") if $Shades <> "" then $Shades = StringSplit($Shades,";") Assign($TartanColor & "Front", Dec("FF" & $Shades[3]),2) Assign($TartanColor & "Back", Dec("FF" & $Shades[4]),2) endif endfunc i can't figure Eval("hCloneV_"& $Color) out. It converts the color name to a RGB or hex color number, Right?It substitutes the handler of image template which was builded according to thread front and back color. The point of world view Link to comment Share on other sites More sharing options...
UEZ Posted April 22, 2010 Share Posted April 22, 2010 You gave some examples in post#4 but I don't want to type each of them into the input field to see it (lazy)? What about a list of Tartans which can be loaded and selected in the GUI? Regards, 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!¯\_(ツ)_/¯ ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ Link to comment Share on other sites More sharing options...
ValeryVal Posted April 23, 2010 Author Share Posted April 23, 2010 You gave some examples in post#4 but I don't want to type each of them into the input field to see it (lazy)? What about a list of Tartans which can be loaded and selected in the GUI? New ATartan has a number of examples and new colors to tartan's palette. ie: Scarlet - S Crimson - Cr or C Azure - A where Scarlet is full name of colour and S - short name for tartan code. expandcollapse popup;=================================================== ; ATartan by Valery Ivanov, 30 March 2010 ;=================================================== ; History ; 1 April: ; - Parts of tartan code can be delimited by space " " (or "," ) ; - More short source ; - New color ("K" means Black) ; - Tartan can use Gy as Gray (used to D) and Bk as Black (used to K) ; - Strip double (or more) spaces between words, leading and trailing white spaces! ; 16 April: ; - New methods (image templates) to improve speed and quality ; 21 April: ; Added ; - start by {Enter} key ; - color layout ; 22 April: ; Added ; - examples ; - new colors to tartan's palette: Scarlet (S), Crimson (Cr or C), Azure (A) #include <GDIPlus.au3> #include <GuiConstantsEx.au3> #include <ScreenCapture.au3> #include <Misc.au3> #include <WinAPI.au3> Opt('MustDeclareVars', 1) ; Global $vDLL_user32 ; Normal Thread Global $EllipseThread = True ; Silk or metalic thread ;Global $EllipseThread = False Global $YellowFront = 0xFFECDC00, $YellowBack = 0xFFD4B300 Global $BlueFront = 0xFF3C9CE0, $BlueBack = 0xFF08419C Global $RedFront = 0xFFE03C9C, $RedBack = 0xFF9C0841 Global $GreenFront = 0xFF3CE09C, $GreenBack = 0xFF089C41 Global $GrayFront = 0xFFC8C8C8, $GrayBack = 0xFF8E8E8E Global $WhiteFront = 0xFFFFFFFF, $WhiteBack = 0xFFC8C8C8 Global $BlackFront = 0xFF404040, $BlackBack = 0xFF000000 Global $ScarletFront = 0xFFDD3131, $ScarletBack = 0xFF8C1717 Global $CrimsonFront = 0xFFEF5272, $CrimsonBack = 0xFFDC143C Global $AzureFront = 0xFFE1E7E7, $AzureBack = 0xFFD1DADA ;Set color layout by it's real name SetColorLayout("Yellow","olive") SetColorLayout("Blue","seagreen") SetColorLayout("Red","goldenrod1") SetColorLayout("Green","kakapo") SetColorLayout("Gray","green quartz") SetColorLayout("White","paleturquoise1") SetColorLayout("Black","army uniform") SetColorLayout("Scarlet","scarlet") SetColorLayout("Crimson","crimson") SetColorLayout("Azure","azure3") Global $FrontColor_Yellow = $YellowFront, $BackColor_Yellow = $YellowBack Global $FrontColor_Blue = $BlueFront, $BackColor_Blue = $BlueBack Global $FrontColor_Gray = $GrayFront, $BackColor_Gray = $GrayBack Global $FrontColor_Red = $RedFront, $BackColor_Red = $RedBack Global $FrontColor_Green = $GreenFront, $BackColor_Green = $GreenBack Global $FrontColor_White = $WhiteFront, $BackColor_White = $WhiteBack Global $FrontColor_Black = $BlackFront, $BackColor_Black = $BlackBack Global $FrontColor_Scarlet = $ScarletFront, $BackColor_Scarlet = $ScarletBack Global $FrontColor_Crimson = $CrimsonFront, $BackColor_Crimson = $CrimsonBack Global $FrontColor_Azure = $AzureFront, $BackColor_Azure = $AzureBack ;Tartan description Global $ColorFullNames = StringSplit("Yellow,Blue,Gray,Red,Green,White,Black,Scarlet,Crimson,Azure",",") Global $ColorShortNames = StringSplit("Y,B,D,R,G,W,K,S,C,A",",") ;Global $TartanShortCode = "Gr12 D4 B12 D4 G12 D4 Gr12 W4 Gr12 D4 G12" Global $TartanShortCode = "G1 R29 B18 Bk2 G15 W3 G15 Y3" Global $TartanShortSet = StringSplit($TartanShortCode,",") ;Middle strip is skipped Global $Tartan_count = 2*$TartanShortSet[0]-1 Global $hBrushFront, $hBrushBack Global $Zoom = 0.5, $Size = Round(90/$Zoom) Global $nHeight = Round(50/$Zoom), $nWidth = Round(50/$Zoom) Global $hCloneV, $hCloneH Global $hGUI Global $RedrawButton, $SaveButton, $ZoomButton, $Pic, $hPic, $Msg Global $CodeLabel, $CreateButton ;Examples Global $ExamplesLabel, $ExamplesChoice Global $ExamplesLine ="" Global $ExamplesCodeLine, $ExamplesCodes, $ExamplesCode, $Examples Global $hBitmap1, $hImage1 Global $hBmpSource, $hImageSource Global $hGraphic Global $FileSaved = @ScriptDir & "\Tartan_tmp.jpg" Global $Caption = "ATartan © Valery Ivanov, 30 March 2010" $vDLL_user32 = DllOpen("user32.dll") ; Create GUI $hGUI = GUICreate($Caption, 900, 800) GUICtrlCreateGroup("Actions:", 10, 10, 170, 780) GUICtrlSetFont(-1, 10, 800, 0, "Verdana") $RedrawButton = GUICtrlCreateButton("Recreate", 40, 40, 110, 20) GUICtrlSetFont(-1, 10, 800, 0, "Verdana") $ZoomButton = GUICtrlCreateButton("Zoom", 40, 70, 110, 20) GUICtrlSetFont(-1, 10, 800, 0, "Verdana") $SaveButton = GUICtrlCreateButton("Save", 40, 100, 110, 20) GUICtrlSetFont(-1, 10, 800, 0, "Verdana") $ExamplesLabel = GUICtrlCreateLabel ("Examples:", 40, 130, 80, 20) GUICtrlSetFont(-1, 10, 800, 0, "Verdana") InitExample() $ExamplesChoice = GUICtrlCreateCombo ("", 40, 150, 110, 20) GUICtrlSetData ($ExamplesChoice, $ExamplesLine, "The Clan Stewart") GUICtrlSetFont(-1, 10, 600, 0, "Times New Roman") GUICtrlCreateGroup("Code:", 185, 10, 710, 55) GUICtrlSetFont(-1, 10, 800, 0, "Verdana") $CodeLabel = GUICtrlCreateInput($TartanShortCode, 200, 40, 500, 20) GUICtrlSetFont(-1, 10, 800, 0, "Verdana") $CreateButton = GUICtrlCreateButton("Create", 720, 40, 110, 20) GUICtrlSetFont(-1, 10, 800, 0, "Verdana") GUICtrlCreateGroup("Tartan:", 185, 75, 710, 720) GUICtrlSetFont(-1, 10, 800, 0, "Verdana") If FileExists($FileSaved) then $Pic = GUICtrlCreatePic($FileSaved, 190, 90, 700, 700) else $Pic = GUICtrlCreatePic("", 190, 90, 700, 700) endif GUISetState() ; Initialize GDI+ library _GDIPlus_Startup() ; Capture client area $hPic = GUICtrlGetHandle($Pic) ; Make there bitmap, image and graphics $hBitmap1 = _ScreenCapture_CaptureWnd("", $hPic) $hImage1 = _GDIPlus_BitmapCreateFromHBITMAP($hBitmap1) $hGraphic = _GDIPlus_ImageGetGraphicsContext($hImage1) CreateBrushes() TartanParse() CreateColorElements($hGraphic) If Not FileExists($FileSaved) then DrawPlaid($hGraphic) While 1 $Msg = GUIGetMsg() switch $Msg case $GUI_EVENT_CLOSE ExitLoop case $CreateButton TartanParse() DrawPlaid($hGraphic) case $RedrawButton DrawPlaid($hGraphic) case $SaveButton SaveTartan() case $ZoomButton $Zoom /= 2 if $Zoom < 0.25 then $Zoom = 2 DrawPlaid($hGraphic) case $ExamplesChoice $ExamplesCode = GetChoiceExample($ExamplesChoice) TartanParse() DrawPlaid($hGraphic) case else endswitch if WinActive($hGUI,"") and _IsPressed("0D",$vDLL_user32) then TartanParse() DrawPlaid($hGraphic) endif WEnd ; Clean up resources DisposeColorElements() DisposeBrushes() _GDIPlus_ImageDispose($hImage1) _WinAPI_DeleteObject($hBitmap1) ; Shut down GDI+ library _GDIPlus_Shutdown() DllClose($vDLL_user32) ;===================================== ; Save Tartan Image func SaveTartan() local $FileName $FileName = FileSaveDialog( "Choose a name.", @ScriptDir, "Image file (*.jpg)", 16, "Tartan.jpg") if @error then MsgBox(4096,"","Save cancelled.") else FileCopy($FileSaved, $FileName, 1) endif endfunc ;===================================== ; Create Brushes func CreateBrushes() local $Col for $i = 1 to $ColorFullNames[0] $Col = $ColorFullNames[$i] Assign("hBrushFront_" & $Col,_GDIPlus_BrushCreateSolid (Eval("FrontColor_" & $Col)),2) Assign("hBrushBack_" & $Col,_GDIPlus_BrushCreateSolid (Eval("BackColor_" & $Col)),2) next endfunc ;===================================== ; Dispose Brushes func DisposeBrushes() local $Col for $i = 1 to $ColorFullNames[0] $Col = $ColorFullNames[$i] _GDIPlus_BrushDispose (Eval("hBrushFront_" & $Col)) _GDIPlus_BrushDispose (Eval("hBrushBack_" & $Col)) next endfunc ;===================================== ; Create ColorElements func CreateColorElements($hG) local $Color if Eval("hCloneV_White") then DisposeColorElements() for $i = 1 to $ColorFullNames[0] $Color = $ColorFullNames[$i] Create_VCells($hG,$Color,$Zoom) Create_HCells($hG,$Color,$Zoom) next endfunc ;===================================== ; Dispose ColorElements func DisposeColorElements() local $Col for $i = 1 to $ColorFullNames[0] $Col = $ColorFullNames[$i] _GDIPlus_ImageDispose(Eval("hCloneV_" & $Col)) _GDIPlus_ImageDispose(Eval("hCloneH_" & $Col)) next endfunc ;===================================== ; Create Vertical Cells func Create_VCells($hG,$Color,$Zoom) local $hBrushFront, $hBrushBack _GDIPlus_GraphicsClear ($hG,0xFFFFFFFF) $hBrushFront = Eval("hBrushFront_" & $Color) $hBrushBack = Eval("hBrushBack_" & $Color) _GDIPlus_GraphicsFillRect($hG, 0,0, 8, 16, $hBrushBack) if $EllipseThread then _GDIPlus_GraphicsFillEllipse($hG, 0,0, 7, 15, $hBrushFront) else _GDIPlus_GraphicsFillRect($hG, 0,0, 7, 15, $hBrushFront) endif Assign("hCloneV_" & $Color, _GDIPlus_BitmapCloneArea ($hImage1, 0, 0, 8, 16, $GDIP_PXF24RGB),2) endfunc ;===================================== ; Create Horizontal Cells func Create_HCells($hG,$Color,$Zoom) local $hBrushFront, $hBrushBack _GDIPlus_GraphicsClear ($hG,0xFFFFFFFF) $hBrushFront = Eval("hBrushFront_" & $Color) $hBrushBack = Eval("hBrushBack_" & $Color) _GDIPlus_GraphicsFillRect($hG, 0,0, 16, 8, $hBrushBack) if $EllipseThread then _GDIPlus_GraphicsFillEllipse($hG, 1,0, 15, 7, $hBrushFront) else _GDIPlus_GraphicsFillRect($hG, 1,0, 15, 7, $hBrushFront) endif Assign("hCloneH_" & $Color, _GDIPlus_BitmapCloneArea ($hImage1, 0, 0, 16, 8, $GDIP_PXF24RGB),2) endfunc ;===================================== ; Draw Plaid func DrawPlaid($hG) local $PosMax, $NStrip = 1, $CurColor Local $Step = 0, $iStep = 0 _GDIPlus_GraphicsClear ($hG,0xFFFFFFFF) $Size = Round(90/$Zoom) $nHeight = Round(50/$Zoom) $nWidth = Round(50/$Zoom) $PosMax = $Tartan_Width_1 - 1 $CurColor = $Tartan_Color_1 $NStrip = 1 ProgressOn("ATartan progress", "Working...", "0 percent") for $i = 0 to $Size $Step += 1 if $Step = Round($Size/100) then $iStep += 1 ProgressSet( $iStep, $iStep & " percent") $Step = 0 endif if $i > $PosMax then $NStrip += 1 if $NStrip > $Tartan_count then $CurColor = "White" else $PosMax += Eval("Tartan_Width_" & $NStrip) $CurColor = Eval("Tartan_Color_" & $NStrip) endif endif Create_Ver_Thread($hG,$i,$CurColor) Create_Hor_Thread($hG,$i,$CurColor) next ProgressSet(100 , "Done", "Complete") sleep(500) ProgressOff() _GDIPlus_ImageSaveToFile($hImage1, $FileSaved) GUICtrlSetImage ($Pic, $FileSaved) endfunc ;===================================== ; Draw Vertical Thread func Create_Ver_Thread($hG,$nCol,$Color) local $iX, $iYStart, $iY, $i $iX = +8*$Zoom*($nCol-1) $iYStart = -8*$Zoom*($nCol-1) for $i = -$nHeight to $nHeight $iY = $iYStart+32*$Zoom*$i if $iX >= -9*$Zoom and $iY >= -13*$Zoom then _GDIPlus_GraphicsDrawImageRectRect ($hG, Eval("hCloneV_"& $Color), 0, 0, 8, 16, $iX,$iY, 8*$Zoom, 16*$Zoom) endif next endfunc ;===================================== ; Draw Horizontal Thread func Create_Hor_Thread($hG,$nRow,$Color) local $iX, $iY, $iXStart, $i $iXStart = 8*$Zoom-8*$Zoom*($nRow-1) $iY = 8*$Zoom+8*$Zoom*($nRow-1) for $i = -$nWidth to $nWidth $iX = $iXStart+32*$Zoom*$i if $iX >= -25*$Zoom and $iY >= -9*$Zoom then _GDIPlus_GraphicsDrawImageRectRect ($hGraphic, Eval("hCloneH_"&$Color), 0, 0, 16, 8, $iX,$iY, 16*$Zoom, 8*$Zoom) endif next endfunc ;===================================== ; Parse Tartan Code func TartanParse() local $TCode, $TSet, $Color, $Width $TartanShortCode = StringStripWS(GUICtrlRead($CodeLabel),7) ;Black color $TartanShortCode = StringReplace($TartanShortCode,"Bk", "K") ;Gray color $TartanShortCode = StringReplace($TartanShortCode,"Gy", "D") ;Crimson color $TartanShortCode = StringReplace($TartanShortCode,"Cr", "C") $TSet = StringSplit($TartanShortCode,", ") $Tartan_count = 2*$TSet[0]-1 For $i = 1 To $TSet[0]-1 $Color = ColorName(StringLeft($TSet[$i],1)) $Width = StringTrimLeft($TSet[$i],1) Assign("Tartan_Color_" & $i,$Color,2) Assign("Tartan_Width_" & $i,$Width,2) Assign("Tartan_Color_" & $Tartan_count+1-$i,$Color,2) Assign("Tartan_Width_" & $Tartan_count+1-$i,$Width,2) next $Color = ColorName(StringLeft($TSet[$TSet[0]],1)) $Width = StringTrimLeft($TSet[$TSet[0]],1) Assign("Tartan_Color_" & $TSet[0],$Color,2) Assign("Tartan_Width_" & $TSet[0],$Width,2) endfunc ;===================================== ; Get full name of color by it's short name func ColorName($ColorShortName) local $DefaultColorName = "White" For $i = 1 To $ColorFullNames[0] if $ColorShortName = $ColorShortNames[$i] then return $ColorFullNames[$i] next return $DefaultColorName endfunc ;===================================== ; Set color layout by it's name func SetColorLayout($TartanColor,$ColorName) local $Shades $Shades = IniRead("CShades.ini", "CShades", $ColorName,"") if $Shades <> "" then $Shades = StringSplit($Shades,";") Assign($TartanColor & "Front", Dec("FF" & $Shades[3]),2) Assign($TartanColor & "Back", Dec("FF" & $Shades[4]),2) endif endfunc ;===================================== func InitExample() local $i, $ExS, $ExSN, $Ex = "" $Ex &= "1;The Clan Stewart;G4 R60 B8 R8 Bk12 Y2 Bk2 W2 Bk2 G20 R8 Bk2 R2 W2|" $Ex &= "2;Prince of Rothsay;W4 R64 G4 R6 G4 R8 G32 R8 G32 R8 G4 R6 G4 R64 W2 R2 W4|" $Ex &= "3;ye principal clovris of ye clanne Stewart;R6 W56 Bk6 W6 Bk6 W6 g26 R16 Bk2 R2 W2|" $Ex &= "4;MakDonnald of ye Ylis;R6 B20 Bk24 G6 Bk2 G2 Bk2 G60 W8|" $Ex &= "5;clan Raynald;B10 R4 B30 R4 Bk16 G52 R6 G2 R4 G6 W6|" $Ex &= "6;Clann Gregour;R128 G36 R10 G16 W4|" $Ex &= "8;Clan Makduffe;R6 G32 B12 Bk12 R48 Bk4 R8|" $Ex &= "9;Makanphersonis;W6 R2 W60 Bk30 W6 Bk18 Y2|" $Ex &= "10;Clann Grant, or clann Grauntacke;R8 B4 R4 b4 R112 B32 R8 G2 R8 G72 R6 G2 R8|" $Ex &= "11;Monrois;Bk36 R8 Bk36 R64 W6|" $Ex &= "12;Clann-Lewid;Bk16 Y2 Bk16 Y24 R2|" $Ex &= "14;Svtherlande;G12 W4 G48 Bk24 B6 Bk4 B4 Bk4 B24 R2 B2R6|" $Ex &= "15;Clanchamron;R8 G24 R8 G24 R64 Y4|" $Ex &= "16;Clanneil;B12 R2 B40 G12 B12 G48 Bk2 G4 W8|" $Ex &= "17;Mackfarlan;Bk54 W48 Bk8 W48|" $Ex &= "18;Clanlavchlan;Bk12 Y4 Bk42 Y4 Bk12 Y48 Bk4 Y12|" $Ex &= "19;Clan-gillean;G12 Bk20 W4 Bk20 G6 Bk8 G60 Bk4|" $Ex &= "21;Fryjjelis in ye Ayrd;R4 B12 R4 G12 R24 W4|" $Ex &= "22;Menghes;W4 R40 Cr2 R2 Cr2 R6 Cr10 W48 R6 W4 R2 W8|" $Ex &= "23;Chyssal;R2 G28 Bk2 G4 Bk2 G4 B14 R56 W2 R12|" $Ex &= "24;Buchananis;Bk2 W18 Cr8 W4 Cr8 W4|" $Ex &= "25;Clan Lawmond;B50 Bk2 B2 Bk2 B4 Bk28 G60 W8 G60 Bk28 B32 Bk2 B6|" $Ex &= "26;Clann Dowgall of Lorne;R8 G18 Bk12 Cr16 R10 G4 R4 G4 R52 G2 R6|" $Ex &= "27;Makyntryris;G10 B26 R6 B26 G64 W10|" $Ex &= "28;Clandonoquhay;G2 R68 B16 R4 G40 R4|" $Ex &= "29;Maknabbis;G14 R4 Cr4 G8 Cr4 R24 Bk2|" $Ex &= "30;Clannkynnon;Bk2 R36 G24 R4 G24 R36 W2|" $Ex &= "31;Makyntosche;R6 G32 Bk24 R56 W4 R10|" $Ex &= "33;Clanngvn;G4 Bk32 G4 Bk32 G60 R4|" $Ex &= "34;Clan-mak-Arthovr;Bk64 G12 Bk24 G60 Y6|" $Ex &= "35;Clanmorgan;B8 Bk24 B8 Bk24 B64 R4|" $Ex &= "36;Makqwhenis;Bk4 R14 Bk4 R14 Bk28 Y2|" $Ex &= "37;Bruiss;W8 R56 G14 R12 G38 R10 G38 R12 G14 R56 Y8|" $Ex &= "38;Dowglass;Bk30 Gy2 Bk2 Gy2 Bk14 Gy28 Bk2 Gy4|" $Ex &= "39;Crawfovrd;R6 g24 R6 G24 R60 W4|" $Ex &= "40;Ruthwen;R4 G2 R58 B36 G30 W6|" $Ex &= "41;Montegomerye;B18 G6 B18 G68|" $Ex &= "42;Hamyltowne;B10 R2 B10 R16 W2|" $Ex &= "43;Wymmis;R8 Bk24 W2 Bk24 R8 Bk8 R52 G2 R10|" $Ex &= "44;Cymyne;Bk4 R54 G8 R4 G8 R8 G18 W2 G18 R8|" $Ex &= "45;Seyntcler;G4 R2 G60 Bk32 W2 B32 R4|" $Ex &= "46;Dvnbarr;R8 Bk2 R56 Bk16 G44 R12|" $Ex &= "47;Leslye;Bk2 R64 B32 R8 Bk12 Y2 Bk12 R8|" $Ex &= "48;Lavdere;G6 B16 G6 Bk8 G30 R4|" $Ex &= "49;Connyngham;Bk8 R2 Bk60 R56 B2 R2 W8|" $Ex &= "50;Lyndeseye;G50 B4 G4 B4 G4 b20 R60 B4 R6|" $Ex &= "51;Haye;R12 G8 Y4 G72 R4 G4 R4 G24 R96 G8 R4 G2 R4 W2|" $Ex &= "52;Dundass;Bk4 G4 R2 G48 Bk24 B32 Bk8|" $Ex &= "53;Ogyluye;B58 Y2 B4 Bk32 G52 Bk2 G4 R6|" $Ex &= "54;Olyfavnt;B8 Bk8 B48 G64 W2 G4|" $Ex &= "55;Setown;G10 W2 G24 R10 B8 R4 Bk8 R64 G2 R4|" $Ex &= "56;Ramsey;Bk8 W4 Bk56 R60 Bk2 R6|" $Ex &= "57;Areskyn;G14 R2 G52 R60 G2 R10|" $Ex &= "58;Wallas;Bk4 R64 Bk60 Y8|" $Ex &= "59;Brodye;Bk10 R60 Bk28 Y2 Bk28 R10|" $Ex &= "60;Barclay;G4 B64 G64 R4|" $Ex &= "61;Murrawe;B56 Bk6 B6 Bk6 B6 Bk20 G54 R6 g54 Bk20 B56 Bk2 B12|" $Ex &= "62;Urqwhart;B4 W2 B24 Bk4 B4 Bk4 B8 Bk24 G52 Bk4 G4 R2|" $Ex &= "63;Rose;G4 R48 B10 R8 B2 R4 B2 R24 W4|" $Ex &= "64;Colqwohovne;B8 Bk4 B40 W2 Bk18 G58 R8|" $Ex &= "65;Drymmond;G4 R2 g2 R56 G16 Bk2 G2 Bk2 G36 R2 G2 R8|" $Ex &= "66;Forbas;R4 G64 Bk36 G10 Bk16 Y4|" $Ex &= "67;Scott;G8 R6 Bk2 R56 G28 R8 G8 W6 G8 R8|" $Ex &= "68;Armstrang;G4 Bk2 G58 Bk24 B4 Bk2 B2 Bk2 B26 R6|" $Ex &= "69;Gordovn;B60 Bk2 B2 Bk2 B8 Bk28 G52 Y2 G2 Y4 G2 Y2 G52 Bk28 B40 Bk2 B8|" $Ex &= "71;Graeme;G24 Bk8 G2 Bk8|" $Ex &= "72;Maxswel;R6 G2 R56 Bk12 R8 G32 R6|" $Ex &= "73;Home;B6 G4 B60 Bk20 R2 Bk4 R2 Bk70|" $Ex &= "74;Johnstoun;Bk4 B4 Bk4 B48 G60 Bk2 G4 Y6|" $Ex &= "75;Kerr;G40 Bk2 G4 Bk2 G6 Bk28 R56 K2 R4 K8|" $Ex &= "76;California;Y4 B1 G10 S2 G10 S4 G10 S2 G10 B16 A28 Bk1 B4" $ExS = StringSplit($Ex,"|") $ExamplesLine = "" $ExamplesCodeLine = "" for $i = 1 to $ExS[0] $ExSN = StringSplit($ExS[$i],";") if $i = $ExS[0] then $ExamplesLine &= $ExSN[2] $ExamplesCodeLine &= $ExSN[3] else $ExamplesLine &= $ExSN[2] & "|" $ExamplesCodeLine &= $ExSN[3] & "|" endif next $ExamplesCodes = StringSplit($ExamplesCodeLine,"|") $Examples = StringSplit($ExamplesLine,"|") endfunc ;============================= ; Return short code of example choiced func GetChoiceExample($CtrlId) local $Example $Example = GuiCtrlRead($CtrlId) for $i = 1 to $Examples[0] if $Example = $Examples[$i] then GUICtrlSetData($CodeLabel, $ExamplesCodes[$i]) return $ExamplesCodes[$i] endif next return "" endfunc So you can weave with help ATartan's design according to book of Mary E. Black http://www.cs.arizona.edu/patterns/weaving/monographs/bme_tart.pdf Enjoy, The point of world view Link to comment Share on other sites More sharing options...
ValeryVal Posted April 23, 2010 Author Share Posted April 23, 2010 Comment to layout addition. Now ATartan has the following layout: ;Set color layout by it's real name SetColorLayout("Yellow","olive") SetColorLayout("Blue","seagreen") SetColorLayout("Red","goldenrod1") SetColorLayout("Green","kakapo") SetColorLayout("Gray","green quartz") SetColorLayout("White","paleturquoise1") SetColorLayout("Black","army uniform") SetColorLayout("Scarlet","scarlet") SetColorLayout("Crimson","crimson") SetColorLayout("Azure","azure3") As you can see ATartan's "Red" is using "goldenrod1" thread. How to set for "Red" more appropriate colour? You can one from these: 1. comment line SetColorLayout("Red","goldenrod1") 2. replace line to something like this: SetColorLayout("Red","darkcherryred") or SetColorLayout("Red","cadmiumreddeep") The point of world view Link to comment Share on other sites More sharing options...
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