Share your repls and programming experiences

← Back to all posts
Colour Thingy
h
CodingCactus (3030)

Hi!

This is a colour thingy!

Basically just shows you colours

I dunno

Commentshotnewtop
CheesyCheese (6)

:music: show ur trooo colours... and thats why eye love youuuu...
so dont bee afraid... to let them shoowwwww :music: (totally didn't forget the rest of the lyrics)

RayvelArjoon (88)

@CodingCactus Did you buy these domains, or did you host them yourself?

CodingCactus (3030)

@RayvelArjoon got it for free with the GitHub student pack thing

adl212 (127)

Simple, but great!

thenullified (150)

<points a gun at you> always has been @ImmaEatYouMan

AtriDey (170)

@thenullified Harry Potter and the oldest joke in the book

GarryHo (6)

Time to make the same bloody thing in Node.js!

BobTheTomatoPie (1062)

I like it, how'd you get it to open up as a link for each color?

CodingCactus (3030)

@BobTheTomatoPie with flask, if you look at the code you will be able to see something like

@app.route('/<colour>')
def colour(colour):
  return flask.render_temate('index.html', colour=colour)

what that does is when you go to that route, it passes that colour into the template and then the js in that does stuff based on it

CodingCactus (3030)

@BobTheTomatoPie basically look at code and you will see, it isnt too complicated I don't think

BobTheTomatoPie (1062)

that is beyond my knowledge lmao @CodingCactus

firefish (529)

https://colours.codingcactus.codes/0x605f57 is totally not the average colour of all the pixels in my pfp
Also, https://colours.codingcactus.codes/brick doesn't work?

CodingCactus (3030)

@firefish that cuz brick isn't a css colour

DynamicSquid (3595)

Bro, I searched up the colour "squid" but nothing came up?

BobTheTomatoPie (1062)

squid is a color you know, just not a css color @CodingCactus

Kudos (30)

It's actually good, and you have your own domain, and you made this with Flask, which seems unreasonable but is efficient. I did this with Reactjs (frontend only), and it has about the same code as yours! It's sorta sad though that a project I spent 3 weeks on got a third of the upvotes (not including yours or mine's).

CodingCactus (3030)

@Kudos you can t do this with just frontend, how do you get the different URLs for each colour?

Kudos (30)

In that way, you can't. That I was wrong.
But with parameters, yes.

ZDev1 (641)

Nice!
But it's easy I can make it with javascript: https://repl.it/@ZDev1/color#index.html

CodingCactus (3030)

@ZDev1 never said it wasn't easy also that isn't the same thing

CodingCactus (3030)

@ZDev1 if I wanted to do something like that I would just use something I made a while ago https://repl.it/@CodingCactus/Colours

BobTheTomatoPie (1062)

coding cactus did a lot more than that, its different @ZDev1

ZDev1 (641)

@BobTheTomatoPie yea I don't need to make the same thing

CodingCactus (3030)

@ZDev1 but you said it was really easy and that you made it with just frontend js but you didn't you gave a different thing

ZDev1 (641)

@CodingCactus ok, I don't need to copy the idea!

CodingCactus (3030)

@ZDev1 erm you were the one that said you did it so um

BuzzawJHKE (20)

Can u make it to where it gives u the ansi escape code?

Coder100 (8543)

ANSI escape codes change differentiate in each terminal, but you can do: \x1b[38;2;⟨r⟩;⟨g⟩;⟨b⟩m for foreground and \x1b[48;2;⟨r⟩;⟨g⟩;⟨b⟩m for background.
@jhke