0

In my python project I am trying to create a colour class to store rgb values

when called I want it to return (r,g,b)

without creating a function within the class to return the values e.g.

var = colour(r,g,b) 
var.getcolour() #would represent (r,g,b)

but rather

var = colour(r,g,b)
var #would represent (r,g,b)

would there be maybe a built in class function that I could override? similar to __ eq__, __ add__, __ sub__ etc...

0 Answers0