I have a color: hex(#aeeb12) or rgb(174, 235, 18).
I need to find 2 analogous colors for this color.
Is there any math formulas to do it programmatically?
Here is the picture:
Asked
Active
Viewed 273 times
2

Wlad Guz
- 75
- 9
-
Define "analogous" first. – juzraai Jun 24 '18 at 13:36
-
@juzraai harmonious colors – Wlad Guz Jun 24 '18 at 15:04
-
edit your title analogous color does nt mean that – Arnault Le Prévost-Corvellec Jun 24 '18 at 15:17
-
where did you get this sample? – Arnault Le Prévost-Corvellec Jun 24 '18 at 15:28
-
1The intent of this question isn't bad, but it would be much more helpful if we knew exactly what programming language you were trying to accomplish this. Even a code snippet of your efforts would be useful to anyone that answers. If no one helps you can always use Google. – Flostin Jun 24 '18 at 15:32
-
i anlyse color of this image : RGB a quite random but HSB only differed on a rotation but not a constante one myColorHue = 107° rihtone = 24° left one 47° i dont know what kind harmonious colors algorythm prodide this kinds of result i need the source to define new angles definition for this – Arnault Le Prévost-Corvellec Jun 24 '18 at 15:34
-
@ArnaultLePrévost-Corvellec https://www.sessions.edu/color-calculator/ – Wlad Guz Jun 24 '18 at 15:40
-
@Flostin java, but its not so important – Wlad Guz Jun 24 '18 at 15:40
-
@Wlad Guz It actually is. Even if you can understand other programming languages that someone may use to answer, it would be most helpful to you if they answered it in Java. it just helps others answer your question better. – Flostin Jun 24 '18 at 15:46
1 Answers
1
according to the site you provide in comment(sessions.edu/color-calculator) you was using analogous pattern for colors : analalogous colors make senses when you convert your rgb colors HSB/HSV representation, i redirect you to this site to understand the way this system represent colors http://colorizer.org/.
Analogous colors is a triads : leftOne mainOne rightOne In HSB representation i define the main one like this : [H, S, B]
- H the Hue is an angle in degree
- S the Saturation is float between 0 and 1
- B Brightness/Value is float between 0 and 1
So leftOne if defined as : [H - 30, S, B] And rightOne if defined as : [H + 30, S, B]
In Java, if you are using the java.awt.color API,the hue is floating value (between 0 and 1) so just devide the angle by 360 ...
here is snipet from how to obtain this result in Java :
double anglerotation = 1d / 12; // 30 /360
Color mainColor = new Color(174, 235, 18);
float[] hsbLeftColor = Color.RGBtoHSB(mainColor.getRed(), mainColor.getGreen(), mainColor.getBlue(), null);
hsbLeftColor[0] -= anglerotation;
Color leftColor = new Color(Color.HSBtoRGB(hsbLeftColor[0], hsbLeftColor[1], hsbLeftColor[2]));
float[] hsbRightColor = Color.RGBtoHSB(mainColor.getRed(), mainColor.getGreen(), mainColor.getBlue(), null);
hsbRightColor[0] += anglerotation;
Color rightColor = new Color(Color.HSBtoRGB(hsbRightColor[0], hsbRightColor[1], hsbRightColor[2]));

Arnault Le Prévost-Corvellec
- 495
- 2
- 9