Create a function that can make a color gradient for CCanvas

Работа завершена

Время выполнения 17 минут

Техническое задание

I am doing some work with CCanvas, and I would like to make a "strength bar" UI display.

For example I would like the strength bar to start off grey, and progress to a more blue color as the value gets higher.

I need someone good with graphics code to help create a function for me that creates the gradient color pallet.


My function signature looks something like this:

void createColorGradient(
   const int width,
   const int height,
   const uint startColorARGB,
   const uint endColorARGB,
   const double gradientAngle,     
   uint &x[],
   uint &y[]
) {
   // Universal Consts
   const double radianPerDegree = 0.0174532925;
        
   // Reszie arrays
   ArrayResize(x, width);
   ArrayResize(y, height);
   
   // Convert angle to gradient
   const double gradientRadian = radianPerDegree * gradientAngle;


I am trying to understand some gradient code I found, but they don't use color so the solution is more complex than I can figure out in a reasonable amount of time.

The functions outputs x, y ARBG values ready for use in CCanvas.

There may be another value needed like gradient step or so, or this may need to be turned into a Class.

Anyone good with graphics let me know your proposals.

 


Откликнулись

1
Разработчик 1
Оценка
(187)
Проекты
262
69%
Арбитраж
12
33% / 67%
Просрочено
16
6%
Свободен
Опубликовал: 993 примера

Информация о проекте

Бюджет
59+ USD
Исполнителю
53.1 USD