颜色库更新

This commit is contained in:
MrZ626
2020-11-04 14:54:05 +08:00
parent ace51afa55
commit 9ad51797d1
3 changed files with 97 additions and 71 deletions

View File

@@ -1,62 +1,88 @@
local rnd=math.random
local sin=math.sin
local COLOR={ local COLOR={
red={1,0,0}, red= {1.0, 0.0, 0.0},
green={0,1,0}, fire= {1.0, 0.4, 0.0},
blue={.2,.2,1}, orange= {1.0, 0.6, 0.0},
yellow={1,1,0}, yellow= {1.0, 1.0, 0.0},
magenta={1,0,1}, lame= {0.7, 1.0, 0.0},
cyan={0,1,1}, grass= {0.5, 1.0, 0.0},
purple={.5,0,1}, green= {0.0, 1.0, 0.0},
orange={1,.6,0}, water= {0.0, 1.0, 0.6},
grey={.6,.6,.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}, lRed= {1.0, 0.5, 0.5},
lGreen={.5,1,.5}, lFire= {1.0, 0.7, 0.5},
lBlue={.6,.6,1}, lOrange= {1.0, 0.8, 0.3},
lYellow={1,1,.5}, lYellow= {1.0, 1.0, 0.5},
lMagenta={1,.5,1}, lLame= {0.8, 1.0, 0.4},
lCyan={.5,1,1}, lGrass= {0.6, 1.0, 0.4},
lPurple={.8,.4,1}, lGreen= {0.5, 1.0, 0.5},
lOrange={1,.7,.3}, lWater= {0.4, 1.0, 0.7},
lGrey={.8,.8,.8}, 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}, dRed= {0.6, 0.0, 0.0},
dGreen={0,.6,0}, dFire= {0.6, 0.3, 0.0},
dBlue={0,0,.6}, dOrange= {0.6, 0.4, 0.0},
dYellow={.6,.6,0}, dYellow= {0.6, 0.6, 0.0},
dMagenta={.6,0,.6}, dLame= {0.5, 0.6, 0.0},
dCyan={0,.6,.6}, dGrass= {0.3, 0.6, 0.0},
dPurple={.3,0,.6}, dGreen= {0.0, 0.6, 0.0},
dOrange={.6,.4,0}, dWater= {0.0, 0.6, 0.4},
dGrey={.3,.3,.3}, 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}, black= {0.0, 0.0, 0.0},
grass={.6,1,0}, dGrey= {0.3, 0.3, 0.3},
water={0,1,.6}, grey= {0.6, 0.6, 0.6},
sky={.6,.75,1}, lGrey= {0.8, 0.8, 0.8},
white= {1.0, 1.0, 1.0},
black={0,0,0},
white={1,1,1},
} }
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 len_list_norm=#list_norm
local rnd=math.random
function COLOR.random_norm() function COLOR.random_norm()
return COLOR[list_norm[rnd(len_list_norm)]] return COLOR[list_norm[rnd(len_list_norm)]]
end 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 local len_list_bright=#list_bright
function COLOR.random_bright() function COLOR.random_bright()
return COLOR[list_bright[rnd(len_list_bright)]] return COLOR[list_bright[rnd(len_list_bright)]]
end 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 local len_list_dark=#list_dark
function COLOR.random_bright() function COLOR.random_bright()
return COLOR[list_dark[rnd(len_list_dark)]] return COLOR[list_dark[rnd(len_list_dark)]]
end end
local sin=math.sin
function COLOR.rainbow(phase) function COLOR.rainbow(phase)
return return
sin(phase)*.4+.6, sin(phase)*.4+.6,

View File

@@ -235,23 +235,23 @@ WIDGET.init("custom_field",{
WIDGET.newText({name="title", x=1020,y=5,font=70,align="R"}), 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.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="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.rainbow( 1.078)},code=setPen(2)}),--B2 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.rainbow( 0.685)},code=setPen(3)}),--B3 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.rainbow( 0.293)},code=setPen(4)}),--B4 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.rainbow(-0.100)},code=setPen(5)}),--B5 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.rainbow(-0.493)},code=setPen(6)}),--B6 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.rainbow(-0.885)},code=setPen(7)}),--B7 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.rainbow(-1.278)},code=setPen(8)}),--B8 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="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.rainbow(-2.063)},code=setPen(10)}),--B10 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.rainbow(-2.456)},code=setPen(11)}),--B11 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.rainbow(-2.849)},code=setPen(12)}),--B12 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.rainbow(-3.242)},code=setPen(13)}),--B13 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.rainbow(-3.634)},code=setPen(14)}),--B14 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.rainbow(-4.027)},code=setPen(15)}),--B15 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.rainbow(-4.412)},code=setPen(16)}),--B16 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="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 WIDGET.newButton({name="b18", x=660, y=290,w=75,color="black", code=setPen(18)}),--HIDE

View File

@@ -33,22 +33,22 @@ local SKIN={}
SKIN.lib={} SKIN.lib={}
SKIN.libMini={} SKIN.libMini={}
SKIN.libColor={ SKIN.libColor={
{COLOR.rainbow( 1.471)}, COLOR.red,
{COLOR.rainbow( 1.078)}, COLOR.fire,
{COLOR.rainbow( 0.685)}, COLOR.orange,
{COLOR.rainbow( 0.293)}, COLOR.yellow,
{COLOR.rainbow(-0.100)}, COLOR.lame,
{COLOR.rainbow(-0.493)}, COLOR.grass,
{COLOR.rainbow(-0.885)}, COLOR.green,
{COLOR.rainbow(-1.278)}, COLOR.water,
{COLOR.rainbow(-1.671)}, COLOR.cyan,
{COLOR.rainbow(-2.063)}, COLOR.sky,
{COLOR.rainbow(-2.456)}, COLOR.sea,
{COLOR.rainbow(-2.849)}, COLOR.blue,
{COLOR.rainbow(-3.242)}, COLOR.purple,
{COLOR.rainbow(-3.634)}, COLOR.grape,
{COLOR.rainbow(-4.027)}, COLOR.magenta,
{COLOR.rainbow(-4.412)}, COLOR.pink,
COLOR.dGrey, COLOR.dGrey,
COLOR.black, COLOR.black,
COLOR.lYellow, COLOR.lYellow,