42 Replies
The part I don't get is
getRed
, getGreen
, getBlue
Are those methods of the Color class?random.nextInt(256)
is a 1:1 translation of Math.floor(Math.random() * 256)
which makes a number from 0-255.
I'm 99% sure that mix.getXYZ()
gets the red/green/blue in the form of 0-255. The Color
type is irrelevant here.
yeah they should beYup I was typing it out and got this:
I just merged the conditional with the assignments
They are the same
yeah they are
well
not strictly as you have a typo
mix.[2]
but that's pedanticnot anymore 😜
oh and you do need to use math.floor
twice
cuz if you get a colour like red = 5 and mix[0] = 2 then
(5 + 2) / 2 = 3.5
and you want an integer colour
as it turns out Java's division operator on integers automatically floors the result
e.g. in JS 5 / 2 = 2.5
but in Java 5 / 2 = 2
while 5.0 / 2.0 = 2.5
@lukeabby https://codepen.io/arcanist/pen/jOmxvPj
is that a satisfying result?
The colors are a bit muted. I also feel like the top and bottom should be more different
You can't even see a gradient on this one
you could try something like passing in sourceColor and something like:
this will make top brighter and bottom as dark as it was before
(or generally top brighter and bottom darker)
(that's not a guarantee)
(top could generate like 0, 0, 0 and bottom could generate 360, 360, 360)
lol
lol
I was going to say. I'm not a fan of grey, black or white
I suppose it is "mostly accurate", lemme guess it was just a random gradient
and the ML algorithms on Discord freaked out
Yeah
It still says that if I crop
lol post on some external site and send the link--
ah
Oh there it worked
is that a better result?
what's better for your application is fully within your opinion haha
No, it's too dark
tinker around with the numbers a bit
instead of
[0, 0, 0]
maybe [25, 25, 25]
I'm just pulling numbers out of a hatIt's inevitably going to spit out greys unless I filter red, green, blue being too similar
it takes a very informal, 'about 10 clicks' for me to get a gray
you don't want grays at all?
grays showing up is what happens if it's truly random
you can revert to your algorithm if you'd like because "it's working"
I hadn't realised you didn't want grays I suppose
I only want colors that are aesthetically pleasing and I think bright, but not neon colors are a better option for that.
Which is why I locked saturation to 80% and luminosity to 40% before
tbf you can have grays with those
but yes
you should consider reverting to your previous algorithm or adapting these ones to do similar
I hadn't realised this component of the filtering was necessary, my bad
No worries, thanks for exploring this with me 🙂
you're welcome
What the heck did it block...
ML for ya
A larger version of this image
Lol, that simple gradient image?
What could it have possibly thought that was.
I mean ML has also blocked pictures of dunes for being explicit imagery in real life
also ML to recognise objects has been tricked to believe something is like a bird with 100% certainty
by a bunch of grayscale pixels
that look like random noise
Yeah, that's the weird thing. It can be very good at identifying that something is a bird, but not so great at knowing that it's not a bird.
yeah ML working and failing is going to be a mystery for a long while at the least I'd expect
it's like when you make a very silly mistake and don't know why
but more computer-y
Yup
The best part of ML is that we don't actually understand how it works 😁
lol yeah
the model I like is we, the coders, know how to train how to score models
but we don't really know how we even get out models that do the right or wrong thing
because the way we train is just a pile of linear algebra