clrp
Privateunrated
Content
131 lines{=(COMMENT):Change the tag name or the prefix per your wish in the variables below.}
{=(TagName):clrp}
{=(prefix):!}
{=(offset):2}
{=(hins):3600}
{=(time):{strf({m:trunc({unix}+({hins}*{offset}))}):%-I:%M %p}}
{=(COMMENT):random decimal value when the input is empty}
{=(randecim):{range:0-16777215}}
{=(COMMENT):turns a hex into a decimal}
{=(spaced):{replace(, ):{replace(#,):{lower:{1}}}}}
{=(values):{replace(a,10):{replace(b,11):{replace(c,12):{replace(d,13):{replace(e,14):{replace(f,15):{spaced}}}}}}}}
{=(length):{index(%&):{replace(, ):{spaced}} %&}}
{=(hextest):{m:trunc({join(+):{replace(, ):{values}}})}}
{=(values):{if({in(#):{1}}==true):{and({hextest}=={m:trunc({hextest}/1)}|{length}==6):{values}|1}}}
{=(l1):{lower:{1}}}
{=(add1):{values(7)}}
{=(add2):{m:{values(6)}*16}}
{=(add3):{m:{values(5)}*(16^2)}}
{=(add4):{m:{values(4)}*(16^3)}}
{=(add5):{m:{values(3)}*(16^4)}}
{=(add6):{m:{values(2)}*(16^5)}}
{=(hexToDecimal):{join():{m:trunc({add1}+{add2}+{add3}+{add4}+{add5}+{add6})}}}
{=(COMMENT):Turns a decimal into a hex}
{=(fmt):{replace(red,16711680):{lower:{1}}}}
{=(decim):{if(=={1}):{randecim}|{and(0<={fmt}|{fmt}<=16777215):{fmt}|1}}}
{=(res1):{m:trunc({decim}/16)}}
{=(res2):{m:trunc({res1}/16)}}
{=(res3):{m:trunc({res2}/16)}}
{=(res4):{m:trunc({res3}/16)}}
{=(res5):{m:trunc({res4}/16)}}
{=(div1):{m:trunc({decim}%16)}}
{=(div2):{m:trunc({res1}%16)}}
{=(div3):{m:trunc({res2}%16)}}
{=(div4):{m:trunc({res3}%16)}}
{=(div5):{m:trunc({res4}%16)}}
{=(div6):{m:trunc({res5}%16)}}
{=(divsum):{replace(15,F):{replace(14,E):{replace(13,D):{replace(12,C):{replace(11,B):{replace(10,A):{div6} {div5} {div4} {div3} {div2} {div1}}}}}}}}
{=(decimalToHex):#{join():{divsum}}}
{=(hex):{if({in(#):{l1}}==true):{upper:{1}}|{decimalToHex}}}
{=(decimal):{if(=={1}):{randecim}|{if({in(#):{l1}}==true):{hexToDecimal}|{fmt}}}}
{=(input):{decimal}}
{=(Red):{m:trunc({input}/65536)}}
{=(Green):{m:trunc(({input}-{Red}*65536)/256)}}
{=(Blue):{m:trunc({input}-({Red}*65536+{Green}*256))}}
{=(Rgb):[{Red}, {Green}, {Blue}]}
{=(type):{if({in(#):{l1}}==true):Hexadecimal|Decimal}}
{=(perRgb):[{m:trunc(({Red}/255)*100)}%, {m:trunc(({Green}/255)*100)}%, {m:trunc(({Blue}/255)*100)}%]}
{=(COMMENT):rgb to hsl conversion}
{=(red):{m:{Red}/255}}
{=(green):{m:{Green}/255}}
{=(blue):{m:{Blue}/255}}
{=(Max):{and({red}>={green}|{red}>={blue}):{red}} {and({green}>={red}|{green}>={blue}):{green}} {and({blue}>={red}|{blue}>={green}):{blue}}}
{=(Min):{and({red}<={green}|{red}<={blue}):{red}} {and({green}<={red}|{green}<={blue}):{green}} {and({blue}<={red}|{blue}<={green}):{blue}}}
{=(len1):{index(&):{Max} &}}
{=(len2):{index(&):{Min} &}}
{=(max):{if({len1}==1):{Max}|{Max({len1})}}}
{=(min):{if({len2}==1):{Min}|{Min({len2})}}}
{=(lum):{m:({max}+{min})/2}}
{=(chroma):{m:{max}-{min}}}
{=(sat):{if({lum}<=0.5):{m:{chroma}/({max}+{min})}|{m:{chroma}/(2-{max}-{min})}}}
{=(hue):{if({max}=={red}):{m:({green}-{blue})/{chroma}}|{if({max}=={green}):{m:2+({blue}-{red})/{chroma}}|{if({blue}=={max}):{m:4+({red}-{green})/{chroma}}}}}}
{=(sat):{if({min}=={max}):0|{m:round({sat}*100)}}}
{=(hue):{m:round({hue}*60)}}
{=(hue):{if({m:sgn({hue})}==-1):{m:round({hue}+360)}|{if({m:sgn({hue})}==0):0|{hue}}}}
{=(hue):{any({min}=={max}|{sat}==0):0|{hue}}}
{=(lum):{m:round({lum}*100)}}
{=(chroma):{m:round({chroma}*100)}%}
{=(hsl):({hue}°, {sat}%, {lum}%)}
{=(COMMENT):hex to binary conversion}
{=(largs):{lower:{hex}}}
{=(binary):{replace(f,1111):{replace(e,1110):{replace(d,1101):{replace(c,1100):{replace(b,1011):{replace(a,1010):{replace(9,1001):{replace(8,1000):{replace(7,0111):{replace(6,0110):{replace(5,0101):{replace(4,0100):{replace(3,0011):{replace(2,0010):{replace(1,0001):{replace(0,0000):{largs}}}}}}}}}}}}}}}}}}
{=(binary):{if({largs}==000000):0|{if({binary}=={binary(2+):1}):{binary}|1{binary(2+):1}}}}
{=(cmyk):<:soonTm:748454517682733127>}
{=(thumbnail):https://res.cloudinary.com/cbrthur/image/upload/e_colorize,co_rgb:{replace(#,):{hex}},w_100,h_100/white_pixel_png_sigmug}
{=(URL):https://encycolorpedia.com/{replace(#,):{hex}}}
{=(COMMENT):error handling}
{=(isArgsEmpty):{if(!={1}):true|false}}
{=(is1Info):{if({l1}!=info):true|false}}
{=(isLHex):{if({in(#):{l1}}==true):{if({length}==6):true|false}|true}}
{=(isValidHexNum):{if({in(#):{l1}}==true):{if({hextest}=={m:trunc({hextest}/1)}):true|false}|true}}
{=(isValidDecim):{if({in(#):{l1}}==false):{if({fmt}=={m:trunc({fmt}/1)}):true|false}|true}}
{=(isInRange):{if({in(#):{l1}}==false):{and(0<={fmt}|{fmt}<=16777215):true|false}|true}}
{=(msg.ArgsEmpty):{"fields":[{"name":"Hex & Decimal","value":"•Input type: {type}\n•Hex: `{hex}`\n•Decimal: `{decimal}`","inline":true},{"name":"HSL & Chroma","value":"•HSL: {hsl}\n •Chroma {chroma}\n","inline":true},{"name":"────────────────────────","value":"** **","inline":false},{"name":"RGB Values","value":"{Rgb}","inline":true},{"name":"Percent per RGB","value":"{perRgb}","inline":true},{"name":"────────────────────────","value":"** **","inline":false},{"name":"CMYK values","value":"{cmyk}","inline":true},{"name":"Binary","value":" {binary}","inline":true}],"color":{decimal},"footer":{"icon_url":"{user(icon)}","text":"{time}"},"title":"Color Information","url":"{URL}","thumbnail":{"url":"{thumbnail}"}}}
{=(msg.Info):{"fields":[{"name":"**Hexadecimal (or hex) codes**","value":"A hex code is a way for computers to represent colors, it is often used in HTML CSS or SVG. Each hexadecimal color code represents a unique color, they can be useful when changing a role color on discord for example. They are made out of 6 characters. They can be made out of letters (from **A** to **F**) or numbers. [More info about hex codes.](https://www.techopedia.com/definition/29788/color-hex-code)","inline":false},{"name":"**Decimal codes** ","value":"Decimal color codes are another way to represent colors. You will often encounter them when using the `embedsource` command with <@235148962103951360>. The value of a decimal color code cannot exceed **16777215** and also needs to be positive or null. They are made out of integer numbers only. ","inline":false},{"name":"**RGB**","value":"The RGB color model is an additive color model in which red, green, and blue light are added together in various ways to reproduce a broad array of colors. Each value of the rgb color space cannot exceed 255. TVs, monitors, phones etc all use RGB to create colors.","inline":false},{"name":"**__How to use__**","value":"Follow the command usage with either a valid hex color code or a decimal color code. Hex codes should be followed by a **#** or else the engine will think your input is decimal. Add extra `0` before the input if it's not made out of 6 character (for hex codes, see example below). \nYou can also run it without args to get a random color!\nExample of a command usage:\n```css\n{prefix}{TagName} #0ffa56```\nRefer to the information above to understand what each value represents and where it could be used.\n","inline":false}],"title":"**Information about each value**","color":3092790,"footer":{"icon_url":"https://cdn.discordapp.com/attachments/776901576962736171/871068814593388605/image.png","text":"Fun fact: There are 16,777,216 different color combinations! "}}}
{=(msg.LHex):{"title":"Invalid Hex code","description":"A hexadecimal code is made out of **6** characters. Double check your input and try again.","color":15403049}}
{=(msg.ValidHexNum):{"title":"Invalid Hex code","description":"Hexadecimal color codes should only contain digits 0-9 and letters A-F, there is an invalid character present, try again.","color":15403049}}
{=(msg.ValidDecim):{"title":"Invalid decimal color code","description":"Decimal color codes need to be positive integer numbers, your input is either negative or contains letters/symbols. Remove the unwanted characters from your input and try again.","color":15403049}}
{=(msg.inRange):{"title":"Invalid decimal color code","description":"Decimal color codes need to be greater or equal to 0 and smaller or equal to 16777215. The value you entered is not in this range, try again.","color":15403049}}
{=(COMMENT):Not fully done for msg.clr}
{=(msg.clr):{msg.ArgsEmpty}}
{=(msg):msg.ArgsEmpty msg.Info msg.ValidHexNum msg.LHex msg.ValidDecim msg.inRange msg.clr}
{=(output):{msg({index(false):0 {isArgsEmpty} {is1Info} {isValidHexNum} {isLHex} {isValidDecim} {isInRange} false})}}
{c:cembed {channel(id)} {{output}}}
{=(COMMENT):8/8/2021 update: HSL and binary values have been added, the play with fields is a success. Still need to work on cmyk values and to make inputs like "red" an acceptable hex value (base hex codes according to html colors)---the changes need have been done, just need to add more replace blocks at line 30-34. Changes have been updated and the tag works really good (after the error messages have been fixed), import link: https://carl.gg/t/996085 & https://carl.gg/t/980371}Raw JSON
{
"id": 980371,
"created_at": "2021-07-31T10:17:41.000Z",
"tag_name": "clrp",
"nsfw": false,
"owner_id": "646441336152784954",
"uses": 409,
"description": null,
"restricted": false,
"shared": false,
"deleted": false,
"safe": "unrated",
"hidden": false,
"guild_id": "776901576086388797",
"sharer": "646441336152784954",
"content": "{=(COMMENT):Change the tag name or the prefix per your wish in the variables below.}\n{=(TagName):clrp}\n{=(prefix):!}\n\n{=(offset):2}\n{=(hins):3600}\n{=(time):{strf({m:trunc({unix}+({hins}*{offset}))}):%-I:%M %p}}\n\n{=(COMMENT):random decimal value when the input is empty}\n{=(randecim):{range:0-16777215}}\n\n{=(COMMENT):turns a hex into a decimal}\n{=(spaced):{replace(, ):{replace(#,):{lower:{1}}}}}\n{=(values):{replace(a,10):{replace(b,11):{replace(c,12):{replace(d,13):{replace(e,14):{replace(f,15):{spaced}}}}}}}}\n{=(length):{index(%&):{replace(, ):{spaced}} %&}}\n{=(hextest):{m:trunc({join(+):{replace(, ):{values}}})}}\n{=(values):{if({in(#):{1}}==true):{and({hextest}=={m:trunc({hextest}/1)}|{length}==6):{values}|1}}}\n\n{=(l1):{lower:{1}}}\n\n{=(add1):{values(7)}}\n{=(add2):{m:{values(6)}*16}}\n{=(add3):{m:{values(5)}*(16^2)}}\n{=(add4):{m:{values(4)}*(16^3)}}\n{=(add5):{m:{values(3)}*(16^4)}}\n{=(add6):{m:{values(2)}*(16^5)}}\n\n{=(hexToDecimal):{join():{m:trunc({add1}+{add2}+{add3}+{add4}+{add5}+{add6})}}}\n\n\n{=(COMMENT):Turns a decimal into a hex}\n{=(fmt):{replace(red,16711680):{lower:{1}}}}\n{=(decim):{if(=={1}):{randecim}|{and(0<={fmt}|{fmt}<=16777215):{fmt}|1}}}\n{=(res1):{m:trunc({decim}/16)}}\n{=(res2):{m:trunc({res1}/16)}}\n{=(res3):{m:trunc({res2}/16)}}\n{=(res4):{m:trunc({res3}/16)}}\n{=(res5):{m:trunc({res4}/16)}}\n\n{=(div1):{m:trunc({decim}%16)}}\n{=(div2):{m:trunc({res1}%16)}}\n{=(div3):{m:trunc({res2}%16)}}\n{=(div4):{m:trunc({res3}%16)}}\n{=(div5):{m:trunc({res4}%16)}}\n{=(div6):{m:trunc({res5}%16)}}\n{=(divsum):{replace(15,F):{replace(14,E):{replace(13,D):{replace(12,C):{replace(11,B):{replace(10,A):{div6} {div5} {div4} {div3} {div2} {div1}}}}}}}}\n\n{=(decimalToHex):#{join():{divsum}}}\n\n{=(hex):{if({in(#):{l1}}==true):{upper:{1}}|{decimalToHex}}}\n{=(decimal):{if(=={1}):{randecim}|{if({in(#):{l1}}==true):{hexToDecimal}|{fmt}}}}\n{=(input):{decimal}}\n{=(Red):{m:trunc({input}/65536)}}\n{=(Green):{m:trunc(({input}-{Red}*65536)/256)}}\n{=(Blue):{m:trunc({input}-({Red}*65536+{Green}*256))}}\n\n{=(Rgb):[{Red}, {Green}, {Blue}]}\n\n{=(type):{if({in(#):{l1}}==true):Hexadecimal|Decimal}}\n{=(perRgb):[{m:trunc(({Red}/255)*100)}%, {m:trunc(({Green}/255)*100)}%, {m:trunc(({Blue}/255)*100)}%]}\n\n{=(COMMENT):rgb to hsl conversion}\n{=(red):{m:{Red}/255}}\n{=(green):{m:{Green}/255}}\n{=(blue):{m:{Blue}/255}}\n\n{=(Max):{and({red}>={green}|{red}>={blue}):{red}} {and({green}>={red}|{green}>={blue}):{green}} {and({blue}>={red}|{blue}>={green}):{blue}}}\n{=(Min):{and({red}<={green}|{red}<={blue}):{red}} {and({green}<={red}|{green}<={blue}):{green}} {and({blue}<={red}|{blue}<={green}):{blue}}}\n\n{=(len1):{index(&):{Max} &}}\n{=(len2):{index(&):{Min} &}}\n{=(max):{if({len1}==1):{Max}|{Max({len1})}}}\n{=(min):{if({len2}==1):{Min}|{Min({len2})}}}\n\n\n{=(lum):{m:({max}+{min})/2}}\n{=(chroma):{m:{max}-{min}}}\n{=(sat):{if({lum}<=0.5):{m:{chroma}/({max}+{min})}|{m:{chroma}/(2-{max}-{min})}}}\n{=(hue):{if({max}=={red}):{m:({green}-{blue})/{chroma}}|{if({max}=={green}):{m:2+({blue}-{red})/{chroma}}|{if({blue}=={max}):{m:4+({red}-{green})/{chroma}}}}}}\n\n{=(sat):{if({min}=={max}):0|{m:round({sat}*100)}}}\n{=(hue):{m:round({hue}*60)}}\n{=(hue):{if({m:sgn({hue})}==-1):{m:round({hue}+360)}|{if({m:sgn({hue})}==0):0|{hue}}}}\n{=(hue):{any({min}=={max}|{sat}==0):0|{hue}}}\n{=(lum):{m:round({lum}*100)}}\n{=(chroma):{m:round({chroma}*100)}%}\n\n{=(hsl):({hue}°, {sat}%, {lum}%)}\n\n{=(COMMENT):hex to binary conversion}\n{=(largs):{lower:{hex}}}\n{=(binary):{replace(f,1111):{replace(e,1110):{replace(d,1101):{replace(c,1100):{replace(b,1011):{replace(a,1010):{replace(9,1001):{replace(8,1000):{replace(7,0111):{replace(6,0110):{replace(5,0101):{replace(4,0100):{replace(3,0011):{replace(2,0010):{replace(1,0001):{replace(0,0000):{largs}}}}}}}}}}}}}}}}}}\n{=(binary):{if({largs}==000000):0|{if({binary}=={binary(2+):1}):{binary}|1{binary(2+):1}}}}\n{=(cmyk):<:soonTm:748454517682733127>}\n\n\n{=(thumbnail):https://res.cloudinary.com/cbrthur/image/upload/e_colorize,co_rgb:{replace(#,):{hex}},w_100,h_100/white_pixel_png_sigmug}\n{=(URL):https://encycolorpedia.com/{replace(#,):{hex}}}\n\n{=(COMMENT):error handling}\n\n{=(isArgsEmpty):{if(!={1}):true|false}}\n{=(is1Info):{if({l1}!=info):true|false}}\n{=(isLHex):{if({in(#):{l1}}==true):{if({length}==6):true|false}|true}}\n{=(isValidHexNum):{if({in(#):{l1}}==true):{if({hextest}=={m:trunc({hextest}/1)}):true|false}|true}}\n{=(isValidDecim):{if({in(#):{l1}}==false):{if({fmt}=={m:trunc({fmt}/1)}):true|false}|true}}\n{=(isInRange):{if({in(#):{l1}}==false):{and(0<={fmt}|{fmt}<=16777215):true|false}|true}}\n\n\n{=(msg.ArgsEmpty):{\"fields\":[{\"name\":\"Hex & Decimal\",\"value\":\"•Input type: {type}\\n•Hex: `{hex}`\\n•Decimal: `{decimal}`\",\"inline\":true},{\"name\":\"HSL & Chroma\",\"value\":\"•HSL: {hsl}\\n •Chroma {chroma}\\n\",\"inline\":true},{\"name\":\"────────────────────────\",\"value\":\"** **\",\"inline\":false},{\"name\":\"RGB Values\",\"value\":\"{Rgb}\",\"inline\":true},{\"name\":\"Percent per RGB\",\"value\":\"{perRgb}\",\"inline\":true},{\"name\":\"────────────────────────\",\"value\":\"** **\",\"inline\":false},{\"name\":\"CMYK values\",\"value\":\"{cmyk}\",\"inline\":true},{\"name\":\"Binary\",\"value\":\" {binary}\",\"inline\":true}],\"color\":{decimal},\"footer\":{\"icon_url\":\"{user(icon)}\",\"text\":\"{time}\"},\"title\":\"Color Information\",\"url\":\"{URL}\",\"thumbnail\":{\"url\":\"{thumbnail}\"}}}\n\n{=(msg.Info):{\"fields\":[{\"name\":\"**Hexadecimal (or hex) codes**\",\"value\":\"A hex code is a way for computers to represent colors, it is often used in HTML CSS or SVG. Each hexadecimal color code represents a unique color, they can be useful when changing a role color on discord for example. They are made out of 6 characters. They can be made out of letters (from **A** to **F**) or numbers. [More info about hex codes.](https://www.techopedia.com/definition/29788/color-hex-code)\",\"inline\":false},{\"name\":\"**Decimal codes** \",\"value\":\"Decimal color codes are another way to represent colors. You will often encounter them when using the `embedsource` command with <@235148962103951360>. The value of a decimal color code cannot exceed **16777215** and also needs to be positive or null. They are made out of integer numbers only. \",\"inline\":false},{\"name\":\"**RGB**\",\"value\":\"The RGB color model is an additive color model in which red, green, and blue light are added together in various ways to reproduce a broad array of colors. Each value of the rgb color space cannot exceed 255. TVs, monitors, phones etc all use RGB to create colors.\",\"inline\":false},{\"name\":\"**__How to use__**\",\"value\":\"Follow the command usage with either a valid hex color code or a decimal color code. Hex codes should be followed by a **#** or else the engine will think your input is decimal. Add extra `0` before the input if it's not made out of 6 character (for hex codes, see example below). \\nYou can also run it without args to get a random color!\\nExample of a command usage:\\n```css\\n{prefix}{TagName} #0ffa56```\\nRefer to the information above to understand what each value represents and where it could be used.\\n\",\"inline\":false}],\"title\":\"**Information about each value**\",\"color\":3092790,\"footer\":{\"icon_url\":\"https://cdn.discordapp.com/attachments/776901576962736171/871068814593388605/image.png\",\"text\":\"Fun fact: There are 16,777,216 different color combinations! \"}}}\n\n{=(msg.LHex):{\"title\":\"Invalid Hex code\",\"description\":\"A hexadecimal code is made out of **6** characters. Double check your input and try again.\",\"color\":15403049}}\n\n{=(msg.ValidHexNum):{\"title\":\"Invalid Hex code\",\"description\":\"Hexadecimal color codes should only contain digits 0-9 and letters A-F, there is an invalid character present, try again.\",\"color\":15403049}}\n\n{=(msg.ValidDecim):{\"title\":\"Invalid decimal color code\",\"description\":\"Decimal color codes need to be positive integer numbers, your input is either negative or contains letters/symbols. Remove the unwanted characters from your input and try again.\",\"color\":15403049}}\n\n{=(msg.inRange):{\"title\":\"Invalid decimal color code\",\"description\":\"Decimal color codes need to be greater or equal to 0 and smaller or equal to 16777215. The value you entered is not in this range, try again.\",\"color\":15403049}}\n\n{=(COMMENT):Not fully done for msg.clr}\n{=(msg.clr):{msg.ArgsEmpty}}\n\n{=(msg):msg.ArgsEmpty msg.Info msg.ValidHexNum msg.LHex msg.ValidDecim msg.inRange msg.clr}\n\n{=(output):{msg({index(false):0 {isArgsEmpty} {is1Info} {isValidHexNum} {isLHex} {isValidDecim} {isInRange} false})}}\n{c:cembed {channel(id)} {{output}}}\n\n\n{=(COMMENT):8/8/2021 update: HSL and binary values have been added, the play with fields is a success. Still need to work on cmyk values and to make inputs like \"red\" an acceptable hex value (base hex codes according to html colors)---the changes need have been done, just need to add more replace blocks at line 30-34. Changes have been updated and the tag works really good (after the error messages have been fixed), import link: https://carl.gg/t/996085 & https://carl.gg/t/980371}",
"embed": "{}",
"last_fetched": "2026-10-20T17:13:39.660Z"
}