art
generative
fxhash
The Eyes of Code – A Generative Journey
written by reyrove
07 Oct 2024100 EDITIONS
1 TEZ
Foundation: Setting the Canvas
const ratio = 1 / 1;
const prefix = 'Eyes';
- Aspect Ratio : This ensures the canvas remains a perfect square, just like a frame that holds the intricate beauty of the eye.
- Prefix : Every artwork generated will carry the name "Eyes," marking each creation as part of this artistic series.
Choosing the Sclera and Iris Colors
const BackgroundColours = ['#F5F5F5', '#EEEEEE', '#E5E4E2', ...];
const setname = ['Blue Eye', 'Dull Blue Eye', 'Ocean Eyes', ...];
- Sclera Colors : A variety of soft whites and pale hues are chosen to represent the sclera, the outer part of the eye. This palette provides a subtle background to contrast the vibrant iris.
- Iris Colors : Different color sets, ranging from Deep Blue to Bright Hazel, give each iris its unique identity, much like real eyes. This random selection ensures no two eyes are ever the same.
Drawing the Iris with Gradient Magic
const gradient = ctx.createLinearGradient(X1, Y1, X2, Y2);
gradient.addColorStop(0, features.Color1[0]);
gradient.addColorStop(1, features.Color1[1]);
- Gradient Effect : The iris is filled with a smooth gradient that transitions between two colors. This gradient mimics the natural depth and complexity found in real irises, where shades blend seamlessly to create a captivating visual.
Curves, Divisions, and Bezier Magic
function drawSmoothClosedBezierCurve(ctx, points, LineWidth, Color) {
// Draws a closed smooth curve using Bezier techniques
}
- Smooth Curves : Using the Bezier curve function, soft, flowing lines are drawn, encircling the iris and giving the eye its iconic rounded form. This function ensures that the lines are organic, mimicking the natural curves found in nature.
Dividing the Eye into Patterns
numberOfDivisions1 = $fx.rand() * 100 + 200;
angle = anglesForEqualDivisions(ctx, numberOfDivisions1);
- Random Divisions : The eye is divided into many angular sections, creating complex radial patterns. Each eye’s division count varies, creating intricate details that enhance the overall composition.
The Final Touches
ctx.arc(0,0,w/10,0,2*Math.PI)
ctx.fillStyle='black';
ctx.fill();
- The Pupil : At the center of it all lies the pupil—a simple black circle. It draws the viewer’s gaze into the center of the piece, much like how the pupil focuses light into the eye itself.
Conclusion: A Window into Creativity
Each execution of "The Eyes of Code" offers something new, a digital representation of a living, breathing entity. From the soft gradients of the iris to the smooth Bezier curves of the eye, this artwork is both technical and soulful—a reminder that in the world of generative art, code and creativity are one.
For the full code and to explore this mesmerizing creation, click here and let your imagination flow through the lines of code!
With all our creativity, love, and the code that opens new eyes to the beauty of digital art,
Yours in endless inspiration,
_Frostbond Coders 🌸