i 在地图上有通用公平标准轨道,困难从1到10。 我希望这些轨道有不同的肤色,取决于困难。 容易的困难是绿色的,硬性是红色的,中度是 o。 然而,我不仅要有这3个颜色,而且要在它们之间实现更平稳的过渡。 每一困难点都有一色,每半点各有一色。 是否有计算这些颜色及其过渡的算法? 和某些方面一样,增加/降低增产价值? 谢谢。
What is the use of default keyword in C#? Is it introduced in C# 3.0 ?
i 在地图上有通用公平标准轨道,困难从1到10。 我希望这些轨道有不同的肤色,取决于困难。 容易的困难是绿色的,硬性是红色的,中度是 o。 然而,我不仅要有这3个颜色,而且要在它们之间实现更平稳的过渡。 每一困难点都有一色,每半点各有一色。 是否有计算这些颜色及其过渡的算法? 和某些方面一样,增加/降低增产价值? 谢谢。
using System;
using System.Drawing;
using System.Windows.Forms;
public partial class MainForm : Form
{
protected override void OnPaint(PaintEventArgs e)
{
Color[] colors = new Color[11];
colors[0] = Color.Green;
colors[1] = Interpolate(Color.Green, Color.Orange, 0.2);
colors[2] = Interpolate(Color.Green, Color.Orange, 0.4);
colors[3] = Interpolate(Color.Green, Color.Orange, 0.6);
colors[4] = Interpolate(Color.Green, Color.Orange, 0.8);
colors[5] = Color.Orange;
colors[6] = Interpolate(Color.Orange, Color.Red, 0.2);
colors[7] = Interpolate(Color.Orange, Color.Red, 0.4);
colors[8] = Interpolate(Color.Orange, Color.Red, 0.6);
colors[9] = Interpolate(Color.Orange, Color.Red, 0.8);
colors[10] = Color.Red;
Rectangle rect = new Rectangle(10, 10, 20, 90);
for (int i = 0; i < colors.Length; i++)
{
e.Graphics.FillRectangle(new SolidBrush(colors[i]), rect);
rect.Offset(20, 0);
}
base.OnPaint(e);
}
private static Color Interpolate(Color a, Color b, double t)
{
int R = (int)(a.R + (b.R - a.R) * t);
int G = (int)(a.G + (b.G - a.G) * t);
int B = (int)(a.B + (b.B - a.B) * t);
return Color.FromArgb(R, G, B);
}
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new MainForm());
}
}
Red = 255,0,0
Yellow = 255, 255, 0
Green = 0,255,0
a. 为1至10级的休息场所提供住宿条件。
每一层次的颜色都是:
Red = level * 25.5;
Green = 255 - (level * 25.5);
Blue = 0;
Then create the color from the RGB values.
显然,这只是假装的编码,它应当给你一个开始的想法。
你回顾的是,能够跨越肤色进行干涉。 简单地跨过两个肤色(因为你可能在彼此之间获得假彩的颜色),而将每一种彩色的彩色的彩色的彩色体作为3D空间的一个点,并沿着代表肤色的多线(在每一点都是肤色/中间的肤色)进行干涉(在你看来是困难的)。 Here。
What is the use of default keyword in C#? Is it introduced in C# 3.0 ?
I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...
I m pretty new to the Objective-C world and I have a long history with .net/C# so naturally I m inclined to use my C# wits. Now here s the question: I feel really inclined to create some type of ...
I cannot figure out how to marshal a C++ CBitmap to a C# Bitmap or Image class. My import looks like this: [DllImport(@"test.dll", CharSet = CharSet.Unicode)] public static extern IntPtr ...
I have two EF entities. One has a property called HouseNumber. The other has two properties, one called StartHouseNumber and one called EndHouseNumber. I want to create a many to many association ...
How to user GhostScript DLL to convert PDF to PDF/A. I know I kind of have to call the exported function of gsdll32.dll whose name is gsapi_init_with_args, but how do i pass the right arguments? BTW, ...
Since I cannot order my dictionary, what is the best way of going about taking key value pairs and also maintaing an index?
Maybe it s something I m doing wrong. I m just learning Linq because I m bored. And so far so good. I made a little program and it basically just outputs all matches (foreach) into a label control. ...