dth

This tag converts the decimal color code you enter into hex code or picks a color randomly and shows its decimal and hex values. Made this tag because the embedsource command returns the color of the the embed in decimal, and i need to google it everytime, and couldn’t find any tag here that converts dec to hex. Previews a thumbnail/image of the color in the embed. It’s set to thumbnail by default but you can change it to image field. Just replace the `{thumbSmall}` in Thumbnail URL with the `{imgLarge}` in Image URL field. Change your prefix in the `{pre}` variable and that’s all. You can play with the placement of the color thumbnail if you want. It’s all written in the comments. Please read the comments before changing anything. Usage: `<p>dth [decimal]`

Sharedunrated

Content

45 lines
{=(COMMENT):CHANGE "." TO YOUR SERVER PREFIX}
{=(pre):.}
{=():}
{=(COMMENT):ERROR HANDLING - DON’T TOUCH IT UNLESS YOU KNOW IT}
{=(isNum):{in({m:sgn({args}1)}):-1 0 1}}
{=(isValid):{all({args}>=0|{args}<16777216):true|false}}
{=(inRange):{any(=={args}|{isValid}==true):true|false}}
{=(allCheck):{any({isNum}==false|{inRange}==false):false|true}}

{=(msg.notNum):__**Improper Number:**__ Please enter a proper decimal number without any random characters.}
{=(msg.notRange):__**Invalid Color Code:**__ Please enter a valid decimal color within range **(0-16777215)**.}
{=(msg.Ignore):}

{=(msg):msg.notNum msg.notRange msg.Ignore}

{=(output):{{msg({index(false):0 {isNum} {inRange} false})}}}

{{if({allCheck}==false):blacklist({output}):{server(id)}}}

{=(COMMENT):DON’T CHANGE ANYTHING HERE}
{=(randomDec):{range:0-16777215}}
{=(dec):{if(=={args}):{randomDec}|{args}}}
{=(c1):{m:trunc({dec}/(16^5))}}
{=(r1):{m:{dec}%(16^5)}}
{=(c2):{m:trunc({r1}/(16^4))}}
{=(r2):{m:{r1}%(16^4)}}
{=(c3):{m:trunc({r2}/(16^3))}}
{=(r3):{m:{r2}%(16^3)}}
{=(c4):{m:trunc({r3}/(16^2))}}
{=(r4):{m:{r3}%(16^2)}}
{=(c5):{m:trunc({r4}/16)}}
{=(c6):{m:trunc({r4}%16)}}
{=(string):{c1} {c2} {c3} {c4} {c5} {c6}}
{=(final):{replace( ,):{replace(10,A):{replace(11,B):{replace(12,C):{replace(13,D):{replace(14,E):{replace(15,F):{string}}}}}}}}}
{=(hex):#{final}}

{=(COMMENT):ONLY TOUCH THIS IF YOU KNOW HOW CLOUDINARY WORKS}
{=(COMMENT):I ALREADY SET A VARIABLE IF YOU WANT TO USE THE IMAGE FIELD AT THE BOTTOM. JUST CALL {imgLarge} IN THE image url (big at the bottom) FIELD and remove the {thumbSmall} from the thumbnail url (small top right) FIELD.}
{=(thumbSmall):https://res.cloudinary.com/demo/image/upload/w_100,h_100,e_colorize,co_rgb:{final}/one_pixel.png}
{=(imgLarge):https://res.cloudinary.com/demo/image/upload/w_350,h_50,e_colorize,co_rgb:{final}/one_pixel.png}
{=(colorInfo):https://encycolorpedia.com/{final}}
{=(em.footer):{pre}dth [decimal] • Custom Command made by Anik#0584}

{embed(color):{hex}}
{embed(url):{colorInfo}}

Embed

1 line
{"color": 5198940, "title": "Decimal to Hex Conversion", "fields": [{"name": "**Decimal Value:**", "value": "{dec}", "inline": true}, {"name": "**Hex Value:**", "value": "{hex}", "inline": true}], "footer": {"text": "{em.footer}"}, "thumbnail": {"url": "{thumbSmall}"}, "description": "\n"}
Raw JSON
{
  "id": 865606,
  "created_at": "2021-06-03T05:45:00.000Z",
  "tag_name": "dth",
  "nsfw": false,
  "owner_id": "319051009513226242",
  "uses": 32,
  "description": "This tag converts the decimal color code you enter into hex code or picks a color randomly and shows its decimal and hex values.\nMade this tag because the embedsource command returns the color of the the embed in decimal, and i need to google it everytime, and couldn’t find any tag here that converts dec to hex. Previews a thumbnail/image of the color in the embed. It’s set to thumbnail by default but you can change it to image field. Just replace the `{thumbSmall}` in Thumbnail URL with the `{imgLarge}` in Image URL field. Change your prefix in the `{pre}` variable and that’s all. You can play with the placement of the color thumbnail if you want. It’s all written in the comments. Please read the comments before changing anything.\n\nUsage: `<p>dth [decimal]`",
  "restricted": false,
  "shared": true,
  "deleted": false,
  "safe": "unrated",
  "hidden": false,
  "guild_id": "634570215291617280",
  "sharer": "319051009513226242",
  "content": "{=(COMMENT):CHANGE \".\" TO YOUR SERVER PREFIX}\n{=(pre):.}\n{=():}\n{=(COMMENT):ERROR HANDLING - DON’T TOUCH IT UNLESS YOU KNOW IT}\n{=(isNum):{in({m:sgn({args}1)}):-1 0 1}}\n{=(isValid):{all({args}>=0|{args}<16777216):true|false}}\n{=(inRange):{any(=={args}|{isValid}==true):true|false}}\n{=(allCheck):{any({isNum}==false|{inRange}==false):false|true}}\n\n{=(msg.notNum):__**Improper Number:**__ Please enter a proper decimal number without any random characters.}\n{=(msg.notRange):__**Invalid Color Code:**__ Please enter a valid decimal color within range **(0-16777215)**.}\n{=(msg.Ignore):}\n\n{=(msg):msg.notNum msg.notRange msg.Ignore}\n\n{=(output):{{msg({index(false):0 {isNum} {inRange} false})}}}\n\n{{if({allCheck}==false):blacklist({output}):{server(id)}}}\n\n{=(COMMENT):DON’T CHANGE ANYTHING HERE}\n{=(randomDec):{range:0-16777215}}\n{=(dec):{if(=={args}):{randomDec}|{args}}}\n{=(c1):{m:trunc({dec}/(16^5))}}\n{=(r1):{m:{dec}%(16^5)}}\n{=(c2):{m:trunc({r1}/(16^4))}}\n{=(r2):{m:{r1}%(16^4)}}\n{=(c3):{m:trunc({r2}/(16^3))}}\n{=(r3):{m:{r2}%(16^3)}}\n{=(c4):{m:trunc({r3}/(16^2))}}\n{=(r4):{m:{r3}%(16^2)}}\n{=(c5):{m:trunc({r4}/16)}}\n{=(c6):{m:trunc({r4}%16)}}\n{=(string):{c1} {c2} {c3} {c4} {c5} {c6}}\n{=(final):{replace( ,):{replace(10,A):{replace(11,B):{replace(12,C):{replace(13,D):{replace(14,E):{replace(15,F):{string}}}}}}}}}\n{=(hex):#{final}}\n\n{=(COMMENT):ONLY TOUCH THIS IF YOU KNOW HOW CLOUDINARY WORKS}\n{=(COMMENT):I ALREADY SET A VARIABLE IF YOU WANT TO USE THE IMAGE FIELD AT THE BOTTOM. JUST CALL {imgLarge} IN THE image url (big at the bottom) FIELD and remove the {thumbSmall} from the thumbnail url (small top right) FIELD.}\n{=(thumbSmall):https://res.cloudinary.com/demo/image/upload/w_100,h_100,e_colorize,co_rgb:{final}/one_pixel.png}\n{=(imgLarge):https://res.cloudinary.com/demo/image/upload/w_350,h_50,e_colorize,co_rgb:{final}/one_pixel.png}\n{=(colorInfo):https://encycolorpedia.com/{final}}\n{=(em.footer):{pre}dth [decimal] • Custom Command made by Anik#0584}\n\n{embed(color):{hex}}\n{embed(url):{colorInfo}}",
  "embed": "{\"color\": 5198940, \"title\": \"Decimal to Hex Conversion\", \"fields\": [{\"name\": \"**Decimal Value:**\", \"value\": \"{dec}\", \"inline\": true}, {\"name\": \"**Hex Value:**\", \"value\": \"{hex}\", \"inline\": true}], \"footer\": {\"text\": \"{em.footer}\"}, \"thumbnail\": {\"url\": \"{thumbSmall}\"}, \"description\": \"\\n\"}",
  "last_fetched": "2026-10-20T16:39:38.817Z"
}