diff --git a/Zframework/color.lua b/Zframework/color.lua index 73670e3d..f08164bd 100644 --- a/Zframework/color.lua +++ b/Zframework/color.lua @@ -1,62 +1,88 @@ -local rnd=math.random -local sin=math.sin local COLOR={ - red={1,0,0}, - green={0,1,0}, - blue={.2,.2,1}, - yellow={1,1,0}, - magenta={1,0,1}, - cyan={0,1,1}, - purple={.5,0,1}, - orange={1,.6,0}, - grey={.6,.6,.6}, + red= {1.0, 0.0, 0.0}, + fire= {1.0, 0.4, 0.0}, + orange= {1.0, 0.6, 0.0}, + yellow= {1.0, 1.0, 0.0}, + lame= {0.7, 1.0, 0.0}, + grass= {0.5, 1.0, 0.0}, + green= {0.0, 1.0, 0.0}, + water= {0.0, 1.0, 0.6}, + cyan= {0.0, 1.0, 1.0}, + sky= {0.0, 0.7, 1.0}, + sea= {0.0, 0.3, 1.0}, + blue= {0.2, 0.2, 1.0}, + purple= {0.4, 0.0, 1.0}, + grape= {0.7, 0.0, 1.0}, + magenta= {1.0, 0.0, 1.0}, + pink= {1.0, 0.0, 0.5}, - lRed={1,.5,.5}, - lGreen={.5,1,.5}, - lBlue={.6,.6,1}, - lYellow={1,1,.5}, - lMagenta={1,.5,1}, - lCyan={.5,1,1}, - lPurple={.8,.4,1}, - lOrange={1,.7,.3}, - lGrey={.8,.8,.8}, + lRed= {1.0, 0.5, 0.5}, + lFire= {1.0, 0.7, 0.5}, + lOrange= {1.0, 0.8, 0.3}, + lYellow= {1.0, 1.0, 0.5}, + lLame= {0.8, 1.0, 0.4}, + lGrass= {0.6, 1.0, 0.4}, + lGreen= {0.5, 1.0, 0.5}, + lWater= {0.4, 1.0, 0.7}, + lCyan= {0.5, 1.0, 1.0}, + lSky= {0.5, 0.8, 1.0}, + lSea= {0.5, 0.6, 1.0}, + lBlue= {0.6, 0.6, 1.0}, + lPurple= {0.7, 0.4, 1.0}, + lGrape= {0.8, 0.4, 1.0}, + lMagenta= {1.0, 0.5, 1.0}, + lPink= {1.0, 0.4, 0.7}, - dRed={.6,0,0}, - dGreen={0,.6,0}, - dBlue={0,0,.6}, - dYellow={.6,.6,0}, - dMagenta={.6,0,.6}, - dCyan={0,.6,.6}, - dPurple={.3,0,.6}, - dOrange={.6,.4,0}, - dGrey={.3,.3,.3}, + dRed= {0.6, 0.0, 0.0}, + dFire= {0.6, 0.3, 0.0}, + dOrange= {0.6, 0.4, 0.0}, + dYellow= {0.6, 0.6, 0.0}, + dLame= {0.5, 0.6, 0.0}, + dGrass= {0.3, 0.6, 0.0}, + dGreen= {0.0, 0.6, 0.0}, + dWater= {0.0, 0.6, 0.4}, + dCyan= {0.0, 0.6, 0.6}, + dSky= {0.0, 0.4, 0.6}, + dSea= {0.0, 0.2, 0.6}, + dBlue= {0.0, 0.0, 0.6}, + dPurple= {0.2, 0.0, 0.6}, + dGrape= {0.4, 0.0, 0.6}, + dMagenta= {0.6, 0.0, 0.6}, + dPink= {0.6, 0.0, 0.3}, - pink={1,0,.6}, - grass={.6,1,0}, - water={0,1,.6}, - sky={.6,.75,1}, - - black={0,0,0}, - white={1,1,1}, + black= {0.0, 0.0, 0.0}, + dGrey= {0.3, 0.3, 0.3}, + grey= {0.6, 0.6, 0.6}, + lGrey= {0.8, 0.8, 0.8}, + white= {1.0, 1.0, 1.0}, } -local list_norm={"red","green","blue","yellow","magenta","cyan","purple","orange","pink","grass"} +local map={ + R="red", G="green", B="blue", C="cyan", Y="yellow", M="magenta", + lR="lRed", lG="lGreen",lB="lBlue", lC="lCyan", lY="lYellow", lM="lMagenta", + dR="dRed", dG="dGreen",dB="dBlue", dC="dCyan", dY="dYellow", dM="dMagenta", + W="white", +}for k,v in next,map do COLOR[k]=COLOR[v]end + +local list_norm={"red","fire","orange","yellow","lame","grass","green","water","cyan","sky","sea","blue","purple","grape","magenta","pink"} local len_list_norm=#list_norm +local rnd=math.random function COLOR.random_norm() return COLOR[list_norm[rnd(len_list_norm)]] end -local list_bright={"lRed","lGreen","lBlue","lYellow","lMagenta","lCyan","lPurple","lOrange"} +local list_bright={"lRed","lFire","lOrange","lYellow","lLame","lGrass","lGreen","lWater","lCyan","lSky","lSea","lBlue","lPurple","lGrape","lMagenta","lPink"} local len_list_bright=#list_bright function COLOR.random_bright() return COLOR[list_bright[rnd(len_list_bright)]] end -local list_dark={"dRed","dGreen","dBlue","dYellow","dMagenta","dCyan","dPurple","dOrange"} +local list_dark={"dRed","dFire","dOrange","dYellow","dLame","dGrass","dGreen","dWater","dCyan","dSky","dSea","dBlue","dPurple","dGrape","dMagenta","dPink"} local len_list_dark=#list_dark function COLOR.random_bright() return COLOR[list_dark[rnd(len_list_dark)]] end +local sin=math.sin function COLOR.rainbow(phase) return sin(phase)*.4+.6, diff --git a/parts/scenes/custom_field.lua b/parts/scenes/custom_field.lua index 59aa9a16..e017560d 100644 --- a/parts/scenes/custom_field.lua +++ b/parts/scenes/custom_field.lua @@ -235,23 +235,23 @@ WIDGET.init("custom_field",{ WIDGET.newText({name="title", x=1020,y=5,font=70,align="R"}), WIDGET.newText({name="subTitle", x=1030,y=50,font=35,align="L",color="grey"}), - WIDGET.newButton({name="b1", x=580, y=130,w=75,color={COLOR.rainbow( 1.471)},code=setPen(1)}),--B1 - WIDGET.newButton({name="b2", x=660, y=130,w=75,color={COLOR.rainbow( 1.078)},code=setPen(2)}),--B2 - WIDGET.newButton({name="b3", x=740, y=130,w=75,color={COLOR.rainbow( 0.685)},code=setPen(3)}),--B3 - WIDGET.newButton({name="b4", x=820, y=130,w=75,color={COLOR.rainbow( 0.293)},code=setPen(4)}),--B4 - WIDGET.newButton({name="b5", x=900, y=130,w=75,color={COLOR.rainbow(-0.100)},code=setPen(5)}),--B5 - WIDGET.newButton({name="b6", x=980, y=130,w=75,color={COLOR.rainbow(-0.493)},code=setPen(6)}),--B6 - WIDGET.newButton({name="b7", x=1060, y=130,w=75,color={COLOR.rainbow(-0.885)},code=setPen(7)}),--B7 - WIDGET.newButton({name="b8", x=1140, y=130,w=75,color={COLOR.rainbow(-1.278)},code=setPen(8)}),--B8 + WIDGET.newButton({name="b1", x=580, y=130,w=75,color=COLOR.red, code=setPen(1)}),--B1 + WIDGET.newButton({name="b2", x=660, y=130,w=75,color=COLOR.fire, code=setPen(2)}),--B2 + WIDGET.newButton({name="b3", x=740, y=130,w=75,color=COLOR.orange, code=setPen(3)}),--B3 + WIDGET.newButton({name="b4", x=820, y=130,w=75,color=COLOR.yellow, code=setPen(4)}),--B4 + WIDGET.newButton({name="b5", x=900, y=130,w=75,color=COLOR.lame, code=setPen(5)}),--B5 + WIDGET.newButton({name="b6", x=980, y=130,w=75,color=COLOR.grass, code=setPen(6)}),--B6 + WIDGET.newButton({name="b7", x=1060, y=130,w=75,color=COLOR.green, code=setPen(7)}),--B7 + WIDGET.newButton({name="b8", x=1140, y=130,w=75,color=COLOR.water, code=setPen(8)}),--B8 - WIDGET.newButton({name="b9", x=580, y=210,w=75,color={COLOR.rainbow(-1.671)},code=setPen(9)}),--B9 - WIDGET.newButton({name="b10", x=660, y=210,w=75,color={COLOR.rainbow(-2.063)},code=setPen(10)}),--B10 - WIDGET.newButton({name="b11", x=740, y=210,w=75,color={COLOR.rainbow(-2.456)},code=setPen(11)}),--B11 - WIDGET.newButton({name="b12", x=820, y=210,w=75,color={COLOR.rainbow(-2.849)},code=setPen(12)}),--B12 - WIDGET.newButton({name="b13", x=900, y=210,w=75,color={COLOR.rainbow(-3.242)},code=setPen(13)}),--B13 - WIDGET.newButton({name="b14", x=980, y=210,w=75,color={COLOR.rainbow(-3.634)},code=setPen(14)}),--B14 - WIDGET.newButton({name="b15", x=1060, y=210,w=75,color={COLOR.rainbow(-4.027)},code=setPen(15)}),--B15 - WIDGET.newButton({name="b16", x=1140, y=210,w=75,color={COLOR.rainbow(-4.412)},code=setPen(16)}),--B16 + WIDGET.newButton({name="b9", x=580, y=210,w=75,color=COLOR.cyan, code=setPen(9)}),--B9 + WIDGET.newButton({name="b10", x=660, y=210,w=75,color=COLOR.sky, code=setPen(10)}),--B10 + WIDGET.newButton({name="b11", x=740, y=210,w=75,color=COLOR.sea, code=setPen(11)}),--B11 + WIDGET.newButton({name="b12", x=820, y=210,w=75,color=COLOR.blue, code=setPen(12)}),--B12 + WIDGET.newButton({name="b13", x=900, y=210,w=75,color=COLOR.purple, code=setPen(13)}),--B13 + WIDGET.newButton({name="b14", x=980, y=210,w=75,color=COLOR.grape, code=setPen(14)}),--B14 + WIDGET.newButton({name="b15", x=1060, y=210,w=75,color=COLOR.magenta, code=setPen(15)}),--B15 + WIDGET.newButton({name="b16", x=1140, y=210,w=75,color=COLOR.pink, code=setPen(16)}),--B16 WIDGET.newButton({name="b17", x=580, y=290,w=75,color="dGrey", code=setPen(17)}),--BONE WIDGET.newButton({name="b18", x=660, y=290,w=75,color="black", code=setPen(18)}),--HIDE diff --git a/parts/skin.lua b/parts/skin.lua index 2f6fb3bf..392965ce 100644 --- a/parts/skin.lua +++ b/parts/skin.lua @@ -33,22 +33,22 @@ local SKIN={} SKIN.lib={} SKIN.libMini={} SKIN.libColor={ - {COLOR.rainbow( 1.471)}, - {COLOR.rainbow( 1.078)}, - {COLOR.rainbow( 0.685)}, - {COLOR.rainbow( 0.293)}, - {COLOR.rainbow(-0.100)}, - {COLOR.rainbow(-0.493)}, - {COLOR.rainbow(-0.885)}, - {COLOR.rainbow(-1.278)}, - {COLOR.rainbow(-1.671)}, - {COLOR.rainbow(-2.063)}, - {COLOR.rainbow(-2.456)}, - {COLOR.rainbow(-2.849)}, - {COLOR.rainbow(-3.242)}, - {COLOR.rainbow(-3.634)}, - {COLOR.rainbow(-4.027)}, - {COLOR.rainbow(-4.412)}, + COLOR.red, + COLOR.fire, + COLOR.orange, + COLOR.yellow, + COLOR.lame, + COLOR.grass, + COLOR.green, + COLOR.water, + COLOR.cyan, + COLOR.sky, + COLOR.sea, + COLOR.blue, + COLOR.purple, + COLOR.grape, + COLOR.magenta, + COLOR.pink, COLOR.dGrey, COLOR.black, COLOR.lYellow,