color

Private

Content

136 lines
{override}

{=(h):0,1,2,3,4,5,6,7,8,9,a,b,c,d,e,f}

{=(q):{if({args}==):~{rand:{h}}~{rand:{h}}~{rand:{h}}~{rand:{h}}~{rand:{h}}~{rand:{h}}~|{lower:{replace(,~):{replace(#,):{1}}}}}}

{=(e):0}
{=(e):{if({contains({list(1):{q}}):0 1 2 3 4 5 6 7 8 9 a b c d e f}==true):{e}|{m:trunc({e}+1)}}}
{=(e):{if({contains({list(2):{q}}):0 1 2 3 4 5 6 7 8 9 a b c d e f}==true):{e}|{m:trunc({e}+1)}}}
{=(e):{if({contains({list(3):{q}}):0 1 2 3 4 5 6 7 8 9 a b c d e f}==true):{e}|{m:trunc({e}+1)}}}
{=(e):{if({contains({list(4):{q}}):0 1 2 3 4 5 6 7 8 9 a b c d e f}==true):{e}|{m:trunc({e}+1)}}}
{=(e):{if({contains({list(5):{q}}):0 1 2 3 4 5 6 7 8 9 a b c d e f}==true):{e}|{m:trunc({e}+1)}}}
{=(e):{if({contains({list(6):{q}}):0 1 2 3 4 5 6 7 8 9 a b c d e f}==true):{e}|{m:trunc({e}+1)}}}

{=(hex1):{if({contains({list(1):{q}}):0 1 2 3 4 5 6 7 8 9 a b c d e f}==true):{list(1):{q}}|{rand:{h}}}}
{=(hex2):{if({contains({list(2):{q}}):0 1 2 3 4 5 6 7 8 9 a b c d e f}==true):{list(2):{q}}|{rand:{h}}}}
{=(hex3):{if({contains({list(3):{q}}):0 1 2 3 4 5 6 7 8 9 a b c d e f}==true):{list(3):{q}}|{rand:{h}}}}
{=(hex4):{if({contains({list(4):{q}}):0 1 2 3 4 5 6 7 8 9 a b c d e f}==true):{list(4):{q}}|{rand:{h}}}}
{=(hex5):{if({contains({list(5):{q}}):0 1 2 3 4 5 6 7 8 9 a b c d e f}==true):{list(5):{q}}|{rand:{h}}}}
{=(hex6):{if({contains({list(6):{q}}):0 1 2 3 4 5 6 7 8 9 a b c d e f}==true):{list(6):{q}}|{rand:{h}}}}

{=(hex):{hex1}{hex2}{hex3}{hex4}{hex5}{hex6}}

{=(rgb1):{replace(a,10):{replace(b,11):{replace(c,12):{replace(d,13):{replace(e,14):{replace(f,15):{hex1}}}}}}}}
{=(rgb2):{replace(a,10):{replace(b,11):{replace(c,12):{replace(d,13):{replace(e,14):{replace(f,15):{hex2}}}}}}}}
{=(rgb3):{replace(a,10):{replace(b,11):{replace(c,12):{replace(d,13):{replace(e,14):{replace(f,15):{hex3}}}}}}}}
{=(rgb4):{replace(a,10):{replace(b,11):{replace(c,12):{replace(d,13):{replace(e,14):{replace(f,15):{hex4}}}}}}}}
{=(rgb5):{replace(a,10):{replace(b,11):{replace(c,12):{replace(d,13):{replace(e,14):{replace(f,15):{hex5}}}}}}}}
{=(rgb6):{replace(a,10):{replace(b,11):{replace(c,12):{replace(d,13):{replace(e,14):{replace(f,15):{hex6}}}}}}}}

{=(rgbr):{m:trunc({rgb1}*16+{rgb2})}}
{=(rgbg):{m:trunc({rgb3}*16+{rgb4})}}
{=(rgbb):{m:trunc({rgb5}*16+{rgb6})}}

{=(rgb):{rgbr}, {rgbg}, {rgbb}}

{=(dec):{m:trunc({rgb1}*16^5+{rgb2}*16^4+{rgb3}*16^3+{rgb4}*16^2+{rgb5}*16+{rgb6})}}

{=(hslr):{m:{rgbr}/255}}
{=(hslg):{m:{rgbg}/255}}
{=(hslb):{m:{rgbb}/255}}

{=(hslmax):{hslr}}
{=(hslmax):{if({hslg}>{hslmax}):{hslg}|{hslmax}}}
{=(hslmax):{if({hslb}>{hslmax}):{hslb}|{hslmax}}}

{=(hslmin):{hslr}}
{=(hslmin):{if({hslg}<{hslmin}):{hslg}|{hslmin}}}
{=(hslmin):{if({hslb}<{hslmin}):{hslb}|{hslmin}}}

{=(hsldelta):{m:{hslmax}-{hslmin}}}

{=(hslhr):{m:(({hslg}-{hslb})/{hsldelta})%6}}
{=(hslhg):{m:({hslb}-{hslr})/{hsldelta}+2}}
{=(hslhb):{m:({hslr}-{hslg})/{hsldelta}+4}}
{=(hslh):{if({hsldelta}==0.0):0|{if({hslmax}=={hslr}):{hslhr}|{if({hslmax}=={hslg}):{hslhg}|{if({hslmax}=={hslb}):{hslhb}}}}}}
{=(hslh):{m:round({hslh}*60)}}
{=(hslhn):{m:trunc({hslh}+360)}}
{=(hslh):{if({hslh}<0):{hslhn}|{hslh}}}

{=(hsll):{m:({hslmax}+{hslmin})/2}}

{=(hslsd):{m:{hsldelta}/(1-{m:abs(2*{hsll}-1)})}}
{=(hsls):{if({hsldelta}==0.0):0|{hslsd}}}

{=(hsls):{m:round({hsls}*100)}}
{=(hsll):{m:round({hsll}*100)}}

{=(hsl):{hslh}°, {hsls}%, {hsll}%}

{=(json):{
    "thumbnail":{
        "url":"https:\/\/www.colorhexa.com\/{hex}.png",
        "width":100,
        "height":100
    },
    "fields":[
        {
            "name":"Decimal",
            "value":"`{dec}`",
            "inline":false
        },
        {
            "name":"HSL",
            "value":"`{hsl}`",
            "inline":false
        },
        {
            "name":"RGB",
            "value":"`{rgb}`",
            "inline":false
        }
    ],
    "color":{dec},
    "type":"rich",
    "url":"https:\/\/encycolorpedia.com\/{hex}",
    "title":"#{hex}"
}}

{=(error):{
    "footer":{
        "text":"ERROR: invalid hexcode",
        "icon_url":"https:\/\/www.colorhexa.com\/ff0000.png"
    },
    "thumbnail":{
        "url":"https:\/\/www.colorhexa.com\/{hex}.png",
        "width":100,
        "height":100
    },
    "description":"Random color",
    "fields":[
        {
            "name":"Decimal",
            "value":"`{dec}`",
            "inline":false
        },
        {
            "name":"HSL",
            "value":"`{hsl}`",
            "inline":false
        },
        {
            "name":"RGB",
            "value":"`{rgb}`",
            "inline":false
        }
    ],
    "color":{dec},
    "type":"rich",
    "url":"https:\/\/encycolorpedia.com\/{hex}",
    "title":"#{hex} ⚠"
}}

{=(output):{if({e}>0):error|json}}

{c:cembed {{output}}}
Raw JSON
{
  "id": 266893,
  "created_at": "2020-07-27T22:49:59.000Z",
  "tag_name": "color",
  "nsfw": false,
  "owner_id": "372027070139596810",
  "uses": 181,
  "description": null,
  "restricted": false,
  "shared": false,
  "deleted": false,
  "safe": "",
  "hidden": false,
  "guild_id": "281116750169505793",
  "sharer": "372027070139596810",
  "content": "{override}\n\n{=(h):0,1,2,3,4,5,6,7,8,9,a,b,c,d,e,f}\n\n{=(q):{if({args}==):~{rand:{h}}~{rand:{h}}~{rand:{h}}~{rand:{h}}~{rand:{h}}~{rand:{h}}~|{lower:{replace(,~):{replace(#,):{1}}}}}}\n\n{=(e):0}\n{=(e):{if({contains({list(1):{q}}):0 1 2 3 4 5 6 7 8 9 a b c d e f}==true):{e}|{m:trunc({e}+1)}}}\n{=(e):{if({contains({list(2):{q}}):0 1 2 3 4 5 6 7 8 9 a b c d e f}==true):{e}|{m:trunc({e}+1)}}}\n{=(e):{if({contains({list(3):{q}}):0 1 2 3 4 5 6 7 8 9 a b c d e f}==true):{e}|{m:trunc({e}+1)}}}\n{=(e):{if({contains({list(4):{q}}):0 1 2 3 4 5 6 7 8 9 a b c d e f}==true):{e}|{m:trunc({e}+1)}}}\n{=(e):{if({contains({list(5):{q}}):0 1 2 3 4 5 6 7 8 9 a b c d e f}==true):{e}|{m:trunc({e}+1)}}}\n{=(e):{if({contains({list(6):{q}}):0 1 2 3 4 5 6 7 8 9 a b c d e f}==true):{e}|{m:trunc({e}+1)}}}\n\n{=(hex1):{if({contains({list(1):{q}}):0 1 2 3 4 5 6 7 8 9 a b c d e f}==true):{list(1):{q}}|{rand:{h}}}}\n{=(hex2):{if({contains({list(2):{q}}):0 1 2 3 4 5 6 7 8 9 a b c d e f}==true):{list(2):{q}}|{rand:{h}}}}\n{=(hex3):{if({contains({list(3):{q}}):0 1 2 3 4 5 6 7 8 9 a b c d e f}==true):{list(3):{q}}|{rand:{h}}}}\n{=(hex4):{if({contains({list(4):{q}}):0 1 2 3 4 5 6 7 8 9 a b c d e f}==true):{list(4):{q}}|{rand:{h}}}}\n{=(hex5):{if({contains({list(5):{q}}):0 1 2 3 4 5 6 7 8 9 a b c d e f}==true):{list(5):{q}}|{rand:{h}}}}\n{=(hex6):{if({contains({list(6):{q}}):0 1 2 3 4 5 6 7 8 9 a b c d e f}==true):{list(6):{q}}|{rand:{h}}}}\n\n{=(hex):{hex1}{hex2}{hex3}{hex4}{hex5}{hex6}}\n\n{=(rgb1):{replace(a,10):{replace(b,11):{replace(c,12):{replace(d,13):{replace(e,14):{replace(f,15):{hex1}}}}}}}}\n{=(rgb2):{replace(a,10):{replace(b,11):{replace(c,12):{replace(d,13):{replace(e,14):{replace(f,15):{hex2}}}}}}}}\n{=(rgb3):{replace(a,10):{replace(b,11):{replace(c,12):{replace(d,13):{replace(e,14):{replace(f,15):{hex3}}}}}}}}\n{=(rgb4):{replace(a,10):{replace(b,11):{replace(c,12):{replace(d,13):{replace(e,14):{replace(f,15):{hex4}}}}}}}}\n{=(rgb5):{replace(a,10):{replace(b,11):{replace(c,12):{replace(d,13):{replace(e,14):{replace(f,15):{hex5}}}}}}}}\n{=(rgb6):{replace(a,10):{replace(b,11):{replace(c,12):{replace(d,13):{replace(e,14):{replace(f,15):{hex6}}}}}}}}\n\n{=(rgbr):{m:trunc({rgb1}*16+{rgb2})}}\n{=(rgbg):{m:trunc({rgb3}*16+{rgb4})}}\n{=(rgbb):{m:trunc({rgb5}*16+{rgb6})}}\n\n{=(rgb):{rgbr}, {rgbg}, {rgbb}}\n\n{=(dec):{m:trunc({rgb1}*16^5+{rgb2}*16^4+{rgb3}*16^3+{rgb4}*16^2+{rgb5}*16+{rgb6})}}\n\n{=(hslr):{m:{rgbr}/255}}\n{=(hslg):{m:{rgbg}/255}}\n{=(hslb):{m:{rgbb}/255}}\n\n{=(hslmax):{hslr}}\n{=(hslmax):{if({hslg}>{hslmax}):{hslg}|{hslmax}}}\n{=(hslmax):{if({hslb}>{hslmax}):{hslb}|{hslmax}}}\n\n{=(hslmin):{hslr}}\n{=(hslmin):{if({hslg}<{hslmin}):{hslg}|{hslmin}}}\n{=(hslmin):{if({hslb}<{hslmin}):{hslb}|{hslmin}}}\n\n{=(hsldelta):{m:{hslmax}-{hslmin}}}\n\n{=(hslhr):{m:(({hslg}-{hslb})/{hsldelta})%6}}\n{=(hslhg):{m:({hslb}-{hslr})/{hsldelta}+2}}\n{=(hslhb):{m:({hslr}-{hslg})/{hsldelta}+4}}\n{=(hslh):{if({hsldelta}==0.0):0|{if({hslmax}=={hslr}):{hslhr}|{if({hslmax}=={hslg}):{hslhg}|{if({hslmax}=={hslb}):{hslhb}}}}}}\n{=(hslh):{m:round({hslh}*60)}}\n{=(hslhn):{m:trunc({hslh}+360)}}\n{=(hslh):{if({hslh}<0):{hslhn}|{hslh}}}\n\n{=(hsll):{m:({hslmax}+{hslmin})/2}}\n\n{=(hslsd):{m:{hsldelta}/(1-{m:abs(2*{hsll}-1)})}}\n{=(hsls):{if({hsldelta}==0.0):0|{hslsd}}}\n\n{=(hsls):{m:round({hsls}*100)}}\n{=(hsll):{m:round({hsll}*100)}}\n\n{=(hsl):{hslh}°, {hsls}%, {hsll}%}\n\n{=(json):{\n    \"thumbnail\":{\n        \"url\":\"https:\\/\\/www.colorhexa.com\\/{hex}.png\",\n        \"width\":100,\n        \"height\":100\n    },\n    \"fields\":[\n        {\n            \"name\":\"Decimal\",\n            \"value\":\"`{dec}`\",\n            \"inline\":false\n        },\n        {\n            \"name\":\"HSL\",\n            \"value\":\"`{hsl}`\",\n            \"inline\":false\n        },\n        {\n            \"name\":\"RGB\",\n            \"value\":\"`{rgb}`\",\n            \"inline\":false\n        }\n    ],\n    \"color\":{dec},\n    \"type\":\"rich\",\n    \"url\":\"https:\\/\\/encycolorpedia.com\\/{hex}\",\n    \"title\":\"#{hex}\"\n}}\n\n{=(error):{\n    \"footer\":{\n        \"text\":\"ERROR: invalid hexcode\",\n        \"icon_url\":\"https:\\/\\/www.colorhexa.com\\/ff0000.png\"\n    },\n    \"thumbnail\":{\n        \"url\":\"https:\\/\\/www.colorhexa.com\\/{hex}.png\",\n        \"width\":100,\n        \"height\":100\n    },\n    \"description\":\"Random color\",\n    \"fields\":[\n        {\n            \"name\":\"Decimal\",\n            \"value\":\"`{dec}`\",\n            \"inline\":false\n        },\n        {\n            \"name\":\"HSL\",\n            \"value\":\"`{hsl}`\",\n            \"inline\":false\n        },\n        {\n            \"name\":\"RGB\",\n            \"value\":\"`{rgb}`\",\n            \"inline\":false\n        }\n    ],\n    \"color\":{dec},\n    \"type\":\"rich\",\n    \"url\":\"https:\\/\\/encycolorpedia.com\\/{hex}\",\n    \"title\":\"#{hex} ⚠\"\n}}\n\n{=(output):{if({e}>0):error|json}}\n\n{c:cembed {{output}}}",
  "embed": "{}",
  "last_fetched": "2026-10-20T22:04:42.208Z"
}