Page Menu
Home
Phabricator (Chris)
Search
Configure Global Search
Log In
Files
F126920
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Authored By
Unknown
Size
1 KB
Referenced Files
None
Subscribers
None
View Options
diff --git a/util/gradient-glow.cpp b/util/gradient-glow.cpp
new file mode 100644
index 00000000..5a921ad3
--- /dev/null
+++ b/util/gradient-glow.cpp
@@ -0,0 +1,27 @@
+#include "gradient-glow.h"
+#include "funcs.h"
+
+namespace Effects{
+
+GradientGlow::GradientGlow(int size, int startColor, int endColor):
+colors(0),
+size(size),
+index(0){
+ colors = new int[size];
+ Util::blend_palette(colors, size / 2, startColor, endColor);
+ Util::blend_palette(colors + size / 2, size / 2, endColor, startColor);
+}
+
+void GradientGlow::update(){
+ index = (index + 1) % size;
+}
+
+int GradientGlow::current(){
+ return colors[index];
+}
+
+GradientGlow::~GradientGlow(){
+ delete[] colors;
+}
+
+}
diff --git a/util/gradient-glow.h b/util/gradient-glow.h
new file mode 100644
index 00000000..f64bf047
--- /dev/null
+++ b/util/gradient-glow.h
@@ -0,0 +1,26 @@
+#ifndef _paintown_gradient_glow_h
+#define _paintown_gradient_glow_h
+
+namespace Effects{
+
+class GradientGlow{
+public:
+ GradientGlow(int size, int startColor, int endColor);
+
+ /* move to next color */
+ void update();
+
+ /* get current color */
+ int current();
+
+ virtual ~GradientGlow();
+
+protected:
+ int * colors;
+ unsigned int size;
+ unsigned int index;
+};
+
+}
+
+#endif
File Metadata
Details
Attached
Mime Type
text/x-diff
Expires
Thu, Jun 11, 1:36 PM (3 w, 4 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
69276
Default Alt Text
(1 KB)
Attached To
Mode
R75 R-Tech1
Attached
Detach File
Event Timeline