carnival: extreme [rewind] (1), 2015
The Australian Council for Computers in Education and the organising committee for ACCE Conference 2016 invite proposals for papers and presentations. Authors are encouraged to address the conference theme—If—by imagining how things might be different. Refereed and non-refereed contributions are invited. More details can be found here.
“Everybody you ever met in your life was brought to you for a reason” | Found by John Beck McConnico (via @rudaycursi)
Every now and then I need to create a series of contrasting colors. For instance, in my mapping app PyTopo, when displaying several track logs at once, I want them to be different colors so it's easy to tell which track is which.
Of course, I could make a list of five or ten different colors and cycle through the list. But I hate doing work that a computer could do for me.
Choosing random RGB (red, green and blue) values for the colors, though, doesn't work so well. Sometimes you end up getting two similar colors together. Other times, you get colors that just don't work well, because they're so light they look white, or so dark they look black, or so unsaturated they look like shades of grey.
What does work well is converting to the HSV color space:
hue, saturation and value.
Hue is a measure of the color -- that it's red, or blue, or
yellow green, or orangeish, or a reddish purple.
Saturation measures how intense the color is: is it a bright, vivid
red or a washed-out red? Value tells you how light or dark it is: is
it so pale it's almost white, so dark it's almost black, or somewhere
in between? (A similar model, called HSL, substitutes Lightness for Value,
but is similar enough in concept.)
If you're not familiar with HSV, you can get a good feel for it by playing with GIMP's color chooser (which pops up when you click the black Foreground or white Background color swatch in GIMP's toolbox). The vertical rainbow bar selects Hue. Once you have a hue, dragging up or down in the square changes Saturation; dragging right or left changes Value. You can also change one at a time by dragging the H, S or V sliders at the upper right of the dialog.
Why does this matter? Because once you've chosen a saturation and value, or at least ensured that saturation is fairly high and value is somewhere in the middle of its range, you can cycle through hues and be assured that you'll get colors that are fairly different each time. If you had a red last time, this time it'll be a green, or yellow, or blue, depending on how much you change the hue.
How does this work programmatically?
PyTopo uses Python-GTK, so I need a function that takes a gtk.gdk.Color
and chooses a new, contrasting Color. Fortunately, gtk.gdk.Color already
has hue, saturation and value built in.
Color.hue is a floating-point number between 0 and 1,
so I just have to choose how much to jump. Like this:
def contrasting_color(color): '''Returns a gtk.gdk.Color of similar saturation and value to the color passed in, but a contrasting hue. gtk.gdk.Color objects have a hue between 0 and 1. ''' if not color: return self.first_track_color; # How much to jump in hue: jump = .37 return gtk.gdk.color_from_hsv(color.hue + jump, color.saturation, color.value)
What if you're not using Python-GTK?
me when people try to show me their baby pictures
DUNE NOISE, VHS / NEW ORLEANS / 2:29 AM
I wonder how feminists will react to this
Probably ignore it then go back to making male tears mugs and gifs
Actually this is a very common idea among feminists
It’s something feminists have been talking about for years it’s called toxic masculinity and it’s one of the common threads among the topic of ‘Patriarchy hurts men too’. If fact the first time I read about toxic masculinity was on a feminist blog.
If you actually read things feminists talk about instead of straw manning them you might know this but OH WELL
this girl was sent by the lord above to save humankind
its been estimated that 600 million or so has been poured into marketing minions so if we estimate the tuition at 40,000 dollars then about 150 students
i don’t know what’s more depressing,that 600 million dollars has been spent on advertizing minions or that 600 million dollars will only pay the tuition of 150 US college students
…… oh my god
You guys…. I’m not saying anything about Minions marketing here, but just math:
150 times $40,000 is $6 million. $600 million would be 15,000 students at $40,000 each.
Don’t skimp on the math classes, okay? That shit is important.
But which one is hotter
The answer explains many of my poor life choices
petition to rename the usa ‘south canada’
what about alaska
are we then normal canada
canada a bit to the left
What about South America? Is that just America? Or South South Canada?
i cried my ass of laughing
i caN’T BREATHE OH MY GOD
I’m not even from Canada but I approve this change of names
M ILKY E H
Milky Eh. I just died.