mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 23:47:45 +00:00
AK+Everywhere: Stop including Vector.h from StringView.h
Preparation for using Error.h from Vector.h. This required moving some things out of line.
This commit is contained in:
parent
e52f987020
commit
5f7d008791
27 changed files with 88 additions and 51 deletions
|
@ -311,6 +311,30 @@ Optional<Color> Color::from_string(StringView const& string)
|
|||
return Color(r.value(), g.value(), b.value(), a.value());
|
||||
}
|
||||
|
||||
Vector<Color> Color::shades(u32 steps, float max) const
|
||||
{
|
||||
float shade = 1.f;
|
||||
float step = max / steps;
|
||||
Vector<Color> shades;
|
||||
for (u32 i = 0; i < steps; i++) {
|
||||
shade -= step;
|
||||
shades.append(this->darkened(shade));
|
||||
}
|
||||
return shades;
|
||||
}
|
||||
|
||||
Vector<Color> Color::tints(u32 steps, float max) const
|
||||
{
|
||||
float shade = 1.f;
|
||||
float step = max / steps;
|
||||
Vector<Color> tints;
|
||||
for (u32 i = 0; i < steps; i++) {
|
||||
shade += step;
|
||||
tints.append(this->lightened(shade));
|
||||
}
|
||||
return tints;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
bool IPC::encode(IPC::Encoder& encoder, Color const& color)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue