## ColourPaleete

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
yarickyarick
Prole
Posts: 15
Joined: Fri Dec 30, 2011 9:48 pm
Contact:

### ColourPaleete

http://colorschemedesigner.com/ - How is this implemented in Love?
tentus
Inner party member
Posts: 1060
Joined: Sun Oct 31, 2010 7:56 pm
Location: Appalachia
Contact:

### Re: ColourPaleete

It's not, it's written in Javascript, If you're asking how to port it over... that's a much harder question.
Kurosuke needs beta testers
coffee
Party member
Posts: 1206
Joined: Wed Nov 02, 2011 9:07 pm

### Re: ColourPaleete

yarickyarick wrote:http://colorschemedesigner.com/ - How is this implemented in Love?
I'm not exactly sure what you mean by implemented but it's easy to copy/paste scheme colors in your projects. Choose you colors, click in export > text. You get something like this:

Code: Select all

var. 1 = #FFDE00 = rgb(255,222,0)
var. 2 = #BFAD30 = rgb(191,173,48)
var. 3 = #A69000 = rgb(166,144,0)
var. 4 = #FFE640 = rgb(255,230,64)
var. 5 = #FFED73 = rgb(255,237,115)

Code: Select all

color_v1 =  love.graphics.setColor(255,222,0)
color_v2 =  love.graphics.setColor(191,173,48)
color_v3 =  love.graphics.setColor(166,144,0)
color_v4 =  love.graphics.setColor(255,230,64)
color_v5 =  love.graphics.setColor(255,237,115)
yarickyarick
Prole
Posts: 15
Joined: Fri Dec 30, 2011 9:48 pm
Contact:

### Re: ColourPaleete

I'm doing a character editor and a player to make it easier to choose the right color, I decided to use a palette in the game, as it is carried at in Love?
MarekkPie
Inner party member
Posts: 587
Joined: Wed Dec 28, 2011 4:48 pm
Contact:

### Re: ColourPaleete

http://love2d.org/forums/viewtopic.php?f=4&t=6862

Check out that thread, yarick. There's a pretty easy way to do it if you just want to plop down an image for your palette.
Jasoco
Inner party member
Posts: 3655
Joined: Mon Jun 22, 2009 9:35 am
Location: Pennsylvania, USA
Contact:

### Re: ColourPaleete

coffee wrote:

Code: Select all

color_v1 =  love.graphics.setColor(255,222,0)
color_v2 =  love.graphics.setColor(191,173,48)
color_v3 =  love.graphics.setColor(166,144,0)
color_v4 =  love.graphics.setColor(255,230,64)
color_v5 =  love.graphics.setColor(255,237,115)
Actually I prefer the easier to remember:

Code: Select all

color = {
red = {255,0,0},
yellow = {255,255,0}
green = {0,255,0},
blue = {0,0,25},
white_trans = {255,255,255,175}
}

love.graphics.setColor(color.red)
And if you have to, you can retrieve its values with color.red[1] for its red value, [2] for green, [3] for blue and [4] for alpha if it's set.
coffee
Party member
Posts: 1206
Joined: Wed Nov 02, 2011 9:07 pm

### Re: ColourPaleete

@Jasoco, I only give that basic answer because I thought yarickyarick didn't know how to apply the values given by colourscheme to LOVE.

I actually use in the same way a huge named database coupled to a custom function
http://love2d.org/forums/viewtopic.php? ... 854#p41738

Anyway now that I understand yarickyarick intentions and back to topic you could yarickyarick instead of using a color wheel do a more simple set of RGB sliders like this for choose the guy shirt color.
http://2000thingswpf.files.wordpress.co ... -start.png
Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

### Re: ColourPaleete

coffee wrote:

Code: Select all

color_v1 =  love.graphics.setColor(255,222,0)
color_v2 =  love.graphics.setColor(191,173,48)
color_v3 =  love.graphics.setColor(166,144,0)
color_v4 =  love.graphics.setColor(255,230,64)
color_v5 =  love.graphics.setColor(255,237,115)
By the way, that doesn't actually work. There are no color objects any more in LÖVE. Jasoco's example is the way to go.
Help us help you: attach a .love.
MarekkPie
Inner party member
Posts: 587
Joined: Wed Dec 28, 2011 4:48 pm
Contact:

### Re: ColourPaleete

Robin wrote:
coffee wrote:

Code: Select all

color_v1 =  love.graphics.setColor(255,222,0)
color_v2 =  love.graphics.setColor(191,173,48)
color_v3 =  love.graphics.setColor(166,144,0)
color_v4 =  love.graphics.setColor(255,230,64)
color_v5 =  love.graphics.setColor(255,237,115)
By the way, that doesn't actually work. There are no color objects any more in LÖVE. Jasoco's example is the way to go.
The closest you could get to having something like that probably would be...

Code: Select all

function color_v1()
love.graphics.setColor(255,222,0)
end
Which just obfuscates the code, in my opinion.
Jasoco
Inner party member
Posts: 3655
Joined: Mon Jun 22, 2009 9:35 am
Location: Pennsylvania, USA
Contact:

### Re: ColourPaleete

Well as long as you name the function something more recognizable like color_red() it'll be fine. You won't need to type or call love.graphics.setColor() yourself anymore unless you need a color not in your assortment of color functions.

### Who is online

Users browsing this forum: No registered users and 31 guests