Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Rainbow Text

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
Corroder
Master Cheater
Reputation: 8

Joined: 10 Apr 2015
Posts: 463

PostPosted: Thu Jan 04, 2018 5:51 pm    Post subject: Rainbow Text Reply with quote

Interest with this topic : http://forum.cheatengine.org/viewtopic.php?t=606507

I try to make it one and post script here because this is lua section :

Code:
function RGBToHex(red, green, blue)
 if(red < 0 or red > 255 or green < 0 or green > 255 or blue < 0 or blue > 255) then
 return nil
 end
 return string.format("0x%.2X%.2X%.2X", red,green,blue)
end

    aliceblue = RGBToHex(240, 248, 255)
    antiquewhite = RGBToHex(250, 235, 215)
    aqua = RGBToHex( 0, 255, 255)
    aquamarine = RGBToHex(127, 255, 212)
    azure = RGBToHex(240, 255, 255)
    beige = RGBToHex(245, 245, 220)
    bisque = RGBToHex(255, 228, 196)
    black = RGBToHex( 0, 0, 0)
    blanchedalmond = RGBToHex(255, 235, 205)
    blue = RGBToHex( 0, 0, 255)
    blueviolet = RGBToHex(138, 43, 226)
    brown = RGBToHex(165, 42, 42)
    burlywood = RGBToHex(222, 184, 135)
    cadetblue = RGBToHex( 95, 158, 160)
    chartreuse = RGBToHex(127, 255, 0)
    chocolate = RGBToHex(210, 105, 30)
    coral = RGBToHex(255, 127, 80)
    cornflowerblue = RGBToHex(100, 149, 237)
    cornsilk = RGBToHex(255, 248, 220)
    crimson = RGBToHex(220, 20, 60)
    cyan = RGBToHex( 0, 255, 255)
    darkblue = RGBToHex( 0, 0, 139)
    dark cyan = RGBToHex( 0, 139, 139)
    darkgoldenrod = RGBToHex(184, 134, 11)
    darkgray = RGBToHex(169, 169, 169)
    darkgreen = RGBToHex( 0, 100, 0)
    darkgrey = RGBToHex(169, 169, 169)
    darkkhaki = RGBToHex(189, 183, 107)
    darkmagenta = RGBToHex(139, 0, 139)
    darkolivegreen = RGBToHex( 85, 107, 47)
    darkorange = RGBToHex(255, 140, 0)
    darkorchid = RGBToHex(153, 50, 204)
    darkred = RGBToHex(139, 0, 0)
    darksalmon = RGBToHex(233, 150, 122)
    darkseagreen = RGBToHex(143, 188, 143)
    darkslateblue = RGBToHex( 72, 61, 139)
    darkslategray = RGBToHex( 47, 79, 79)
    darkslategrey = RGBToHex( 47, 79, 79)
    darkturquoise = RGBToHex( 0, 206, 209)
    darkviolet = RGBToHex(148, 0, 211)
    deeppink = RGBToHex(255, 20, 147)
    deepskyblue = RGBToHex( 0, 191, 255)
    dimgray = RGBToHex(105, 105, 105)
    dimgrey = RGBToHex(105, 105, 105)
    dodgerblue = RGBToHex( 30, 144, 255)
    firebrick = RGBToHex(178, 34, 34)
    floralwhite = RGBToHex(255, 250, 240)
    forestgreen = RGBToHex( 34, 139, 34)
    fuchsia = RGBToHex(255, 0, 255)
    gainsboro = RGBToHex(220, 220, 220)
    ghostwhite = RGBToHex(248, 248, 255)
    gold = RGBToHex(255, 215, 0)
    goldenrod = RGBToHex(218, 165, 32)
    gray = RGBToHex(128, 128, 128)
    grey = RGBToHex(128, 128, 128)
    green = RGBToHex( 0, 128, 0)
    greenyellow = RGBToHex(173, 255, 47)
    honeydew = RGBToHex(240, 255, 240)
    hotpink = RGBToHex(255, 105, 180)
    indianred = RGBToHex(205, 92, 92)
    indigo = RGBToHex( 75, 0, 130)
    ivory = RGBToHex(255, 255, 240)
    khaki = RGBToHex(240, 230, 140)
    lavender = RGBToHex(230, 230, 250)
    lavenderblush = RGBToHex(255, 240, 245)
    lawngreen = RGBToHex(124, 252, 0)
    lemonchiffon = RGBToHex(255, 250, 205)
    lightblue = RGBToHex(173, 216, 230)
    lightcoral = RGBToHex(240, 128, 128)
    lightcyan = RGBToHex(224, 255, 255)
    lightgoldenrodyellow = RGBToHex(250, 250, 210)
    lightgray = RGBToHex(211, 211, 211)
    lightgreen = RGBToHex(144, 238, 144)
    lightgrey = RGBToHex(211, 211, 211)
    lightpink = RGBToHex(255, 182, 193)
    lightsalmon = RGBToHex(255, 160, 122)
    lightseagreen = RGBToHex( 32, 178, 170)
    lightskyblue = RGBToHex(135, 206, 250)
    lightslategray = RGBToHex(119, 136, 153)
    lightslategrey = RGBToHex(119, 136, 153)
    lightsteelblue = RGBToHex(176, 196, 222)
    lightyellow = RGBToHex(255, 255, 224)
    lime = RGBToHex( 0, 255, 0)
    limegreen = RGBToHex( 50, 205, 50)
    linen = RGBToHex(250, 240, 230)
    magenta = RGBToHex(255, 0, 255)
    maroon = RGBToHex(128, 0, 0)
    mediumaquamarine = RGBToHex(102, 205, 170)
    mediumblue = RGBToHex( 0, 0, 205)
    mediumorchid = RGBToHex(186, 85, 211)
    mediumpurple = RGBToHex(147, 112, 219)
    mediumseagreen = RGBToHex( 60, 179, 113)
    mediumslateblue = RGBToHex(123, 104, 238)
    mediumspringgreen = RGBToHex( 0, 250, 154)
    mediumturquoise = RGBToHex( 72, 209, 204)
    mediumvioletred = RGBToHex(199, 21, 133)
    midnightblue = RGBToHex( 25, 25, 112)
    mintcream = RGBToHex(245, 255, 250)
    mistyrose = RGBToHex(255, 228, 225)
    moccasin = RGBToHex(255, 228, 181)
    navajowhite = RGBToHex(255, 222, 173)
    navy = RGBToHex( 0, 0, 128)
    oldlace = RGBToHex(253, 245, 230)
    olive = RGBToHex(128, 128, 0)
    olivedrab = RGBToHex(107, 142, 35)
    orange = RGBToHex(255, 165, 0)
    orangered = RGBToHex(255, 69, 0)
    orchid = RGBToHex(218, 112, 214)
    palegoldenrod = RGBToHex(238, 232, 170)
    palegreen = RGBToHex(152, 251, 152)
    paleturquoise = RGBToHex(175, 238, 238)
    palevioletred = RGBToHex(219, 112, 147)
    papayawhip = RGBToHex(255, 239, 213)
    peachpuff = RGBToHex(255, 218, 185)
    peru = RGBToHex(205, 133, 63)
    pink = RGBToHex(255, 192, 203)
    plum = RGBToHex(221, 160, 221)
    powderblue = RGBToHex(176, 224, 230)
    purple = RGBToHex(128, 0, 128)
    red = RGBToHex(255, 0, 0)
    rosybrown = RGBToHex(188, 143, 143)
    royalblue = RGBToHex( 65, 105, 225)
    saddlebrown = RGBToHex(139, 69, 19)
    salmon = RGBToHex(250, 128, 114)
    sandybrown = RGBToHex(244, 164, 96)
    seagreen = RGBToHex( 46, 139, 87)
    seashell = RGBToHex(255, 245, 238)
    sienna = RGBToHex(160, 82, 45)
    silver = RGBToHex(192, 192, 192)
    skyblue = RGBToHex(135, 206, 235)
    slateblue = RGBToHex(106, 90, 205)
    slategray = RGBToHex(112, 128, 144)
    slategrey = RGBToHex(112, 128, 144)
    snow = RGBToHex(255, 250, 250)
    springgreen = RGBToHex( 0, 255, 127)
    steelblue = RGBToHex( 70, 130, 180)
    tan = RGBToHex(210, 180, 140)
    teal = RGBToHex( 0, 128, 128)
    thistle = RGBToHex(216, 191, 216)
    tomato = RGBToHex(255, 99, 71)
    turquoise = RGBToHex( 64, 224, 208)
    violet = RGBToHex(238, 130, 238)
    wheat = RGBToHex(245, 222, 179)
    white = RGBToHex(255, 255, 255)
    whitesmoke = RGBToHex(245, 245, 245)
    yellow = RGBToHex(255, 255, 0)
    yellowgreen = RGBToHex(154, 205, 50)

-- local function pRainbow(text)  ----->  Only work in Lua Terminal
--  local cols={red;orange;yellow;green;blue;purple}
--  for x=1,#text do
--   local colnum=x
--   while colnum>#cols do colnum=colnum-#cols end
--   term.setTextColor(cols[colnum])
--   write(string.sub(text,x,x))
--  end
-- end

---- SAMPLE TO MAKING RAINBOW TEXT ON CE FORM LABEL ------
local _colors = {red,orange,yellow,green,blue,purple,yellowgreen,pink,springgreen,orchid,navy,magenta,maroon}

t = 'Rainbow Text'
tc = string.len(t)

f = createForm()
f.width = 300
f.heigth = 100

n = 1
xcol = 1
lbleft = 5
lbtop = 10

for i = n,tc,1
do
 lb = createLabel(f)
 lb.left = lbleft
 lb.top = lbtop
 lb.Caption = string.sub(t, i, i)
 lb.Font.Color = _colors[xcol]
 lb.font.size = 18
 lb.name = 'L'..tostring(n)
 n = n + 1
 lbleft = lbleft + 10
 xcol = xcol + 1
end


Maybe this is a stupid way since there are other simple and smart way to make it using CE lua. Some one should do it better.

Cheers...



RbwText.JPG
 Description:
Rainbow text using CE labels
 Filesize:  13.33 KB
 Viewed:  348 Time(s)

RbwText.JPG



_________________
Singapore Sling + Johnnie Walker + Some Peanuts....
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites