grok-image-generator 1768.531.555

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. checksums.yaml +7 -0
  2. data/lib/grok_image_generator.rb +96 -0
  3. metadata +44 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: c7fe575452cb5d4ada83bd66ea3f5d0f8e2891324b3fe934734ad04355e54497
4
+ data.tar.gz: 374aca325234d242244ed684423e7060a1a1a965e0a06d7c786d789d12299a63
5
+ SHA512:
6
+ metadata.gz: a8249da452143920c3bdc24224baee5b8a243b9500a709a9393b4f89620bf08ba8f88c2108a891564b9922fe421e2d44ed14b474851eb09e02c14c216138d98c
7
+ data.tar.gz: 2481c1cb7cc2d08fab7d7f63c197fb3a2d9f2deee6904e4ebdcbe0723708e72c3f4963331e7797e3145db3cb4a2b9c49dd819885ce801a17bd3a6d961d2d95ec
@@ -0,0 +1,96 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Module for generating images inspired by the Grok image generator.
4
+ #
5
+ # This module provides core functionalities for generating images.
6
+ # For extended capabilities and cloud-based features, visit:
7
+ # https://supermaker.ai/blog/-grok-image-generator-model-on-supermaker-ai-twitterready-images-made-simple/
8
+ module GrokImageGenerator
9
+ SUPERMAKER_URL = 'https://supermaker.ai/blog/-grok-image-generator-model-on-supermaker-ai-twitterready-images-made-simple/'.freeze
10
+
11
+ # Utility method to construct a full URL based on a path.
12
+ #
13
+ # @param path [String] The path to append to the base URL.
14
+ # @return [String] The full URL.
15
+ def self.get_endpoint(path)
16
+ "#{SUPERMAKER_URL}/#{path}"
17
+ end
18
+
19
+ # Class representing a color palette.
20
+ class ColorPalette
21
+ attr_reader :primary_color, :secondary_color, :accent_color
22
+
23
+ # Initializes a new ColorPalette.
24
+ #
25
+ # @param primary_color [String] The primary color (e.g., '#FFFFFF').
26
+ # @param secondary_color [String] The secondary color (e.g., '#000000').
27
+ # @param accent_color [String] The accent color (e.g., '#FF0000').
28
+ def initialize(primary_color:, secondary_color:, accent_color:)
29
+ @primary_color = primary_color
30
+ @secondary_color = secondary_color
31
+ @accent_color = accent_color
32
+ end
33
+
34
+ # Returns a hash representation of the color palette.
35
+ #
36
+ # @return [Hash] A hash containing the primary, secondary, and accent colors.
37
+ def to_h
38
+ {
39
+ primary_color: @primary_color,
40
+ secondary_color: @secondary_color,
41
+ accent_color: @accent_color
42
+ }
43
+ end
44
+ end
45
+
46
+ # Class for generating text overlays for images.
47
+ class TextOverlay
48
+ attr_reader :text, :font_size, :font_family, :color, :position
49
+
50
+ # Initializes a new TextOverlay.
51
+ #
52
+ # @param text [String] The text to overlay.
53
+ # @param font_size [Integer] The font size of the text.
54
+ # @param font_family [String] The font family of the text.
55
+ # @param color [String] The color of the text (e.g., '#FFFFFF').
56
+ # @param position [Symbol] The position of the text (:top_left, :top_right, :bottom_left, :bottom_right, :center).
57
+ def initialize(text:, font_size:, font_family:, color:, position:)
58
+ @text = text
59
+ @font_size = font_size
60
+ @font_family = font_family
61
+ @color = color
62
+ @position = position
63
+ end
64
+
65
+ # Returns a hash representation of the text overlay.
66
+ #
67
+ # @return [Hash] A hash containing the text overlay attributes.
68
+ def to_h
69
+ {
70
+ text: @text,
71
+ font_size: @font_size,
72
+ font_family: @font_family,
73
+ color: @color,
74
+ position: @position
75
+ }
76
+ end
77
+ end
78
+
79
+ # Generates a basic image configuration.
80
+ #
81
+ # This method provides a simple configuration for image generation.
82
+ # For extended capabilities and cloud-based features, visit:
83
+ # https://supermaker.ai/blog/-grok-image-generator-model-on-supermaker-ai-twitterready-images-made-simple/
84
+ #
85
+ # @param width [Integer] The width of the image.
86
+ # @param height [Integer] The height of the image.
87
+ # @param background_color [String] The background color of the image (e.g., '#EEEEEE').
88
+ # @return [Hash] A hash containing the image configuration.
89
+ def self.generate_image_config(width:, height:, background_color:)
90
+ {
91
+ width: width,
92
+ height: height,
93
+ background_color: background_color
94
+ }
95
+ end
96
+ end
metadata ADDED
@@ -0,0 +1,44 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: grok-image-generator
3
+ version: !ruby/object:Gem::Version
4
+ version: 1768.531.555
5
+ platform: ruby
6
+ authors:
7
+ - SuperMaker
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2026-01-16 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description:
14
+ email:
15
+ - support@supermaker.ai
16
+ executables: []
17
+ extensions: []
18
+ extra_rdoc_files: []
19
+ files:
20
+ - lib/grok_image_generator.rb
21
+ homepage: https://supermaker.ai/blog/-grok-image-generator-model-on-supermaker-ai-twitterready-images-made-simple/
22
+ licenses:
23
+ - MIT
24
+ metadata: {}
25
+ post_install_message:
26
+ rdoc_options: []
27
+ require_paths:
28
+ - lib
29
+ required_ruby_version: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '2.6'
34
+ required_rubygems_version: !ruby/object:Gem::Requirement
35
+ requirements:
36
+ - - ">="
37
+ - !ruby/object:Gem::Version
38
+ version: '0'
39
+ requirements: []
40
+ rubygems_version: 3.0.3.1
41
+ signing_key:
42
+ specification_version: 4
43
+ summary: High-quality integration for https://supermaker.ai/blog/-grok-image-generator-model-on-supermaker-ai-twitterready-images-made-simple/
44
+ test_files: []