- Joined
- Feb 19, 2020
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
extends Node2D
@onready var color_rect = $ColorRect
@onready var slider = $HSlider # Step size 365 to get individual years
@onready var label = $Label
@onready var year_rects = $YearRects
@export var H_curve: Curve
@export var S_curve: Curve
@export var V_curve: Curve
# Account must be at least 4380 days old to land in 2013 (as of 12/31/2024)
# Start color: FF5CFF
# Must pass through: 6BA65E from_hsv(0.30278, 0.43, 0.65)
# Will occur at Year 7 (0.58333)
# End color: 9E0000
func days_to_col(days: int) -> Color:
# TODO: Get days since 12/31/2013 and replace 4380 with that
days = clampi(days, 0, 4380)
var day_weight: float = float(days) / 4380.0
print("Day weight: ", day_weight)
var h: float # start: 0.833 end: 0.0
h = H_curve.sample(day_weight)
var s: float # start: 0.64 end: 1.0
s = S_curve.sample(day_weight)
var v: float # start: 1.0 end: 0.62
v = V_curve.sample(day_weight)
return Color.from_hsv(h, s, v)
func _ready() -> void:
update_everything()
color_years()
func update_everything() -> void:
color_rect.color = days_to_col(slider.value)
label.text = ("Days since joined: " + str(slider.value) + "
Output color: #" + color_rect.color.to_html(false))
func _on_h_slider_value_changed(value):
update_everything()
func color_years() -> void:
var rects: Array[Node] = year_rects.get_children()
for i:int in 13:
rects[i].color = days_to_col(i * 365)
import colorsys
import numpy as np
from scipy import interpolate
import matplotlib.pyplot as plt
import matplotlib.ticker as mticker
# Generate a rainbow color ramp from Oldhead red to Newfriend pink, starting in 2012.
# end_year: Final year of color ramp.
# start_year: First year to begin 'ramping.' The start_year and all years before start_year will be Oldhead red.
# kiwi_lightness: Reference lightness of Kiwi green. Increase to make color ramp brighter.
def create_kiwi_color_ramp_hls(end_year, start_year=2013, kiwi_lightness=0.51):
# Use HLS colorspace to create color ramp. Use generic points to define the curves.
# Saturation and lightness should stay in the neighborhood of Kiwi green.
# Kiwi green: (H=109°, L=51%, S=29%)
# Oldhead red: (H=0°, L=31%, S=100%)
# Newfriend pink: (H=300°, L=50%, S=100%)
# Saturation needs to start at 100%, go down to 29%, and back up to 100%. Use a quadratic function.
saturation_curve_x = np.linspace(0, 1, 10)
saturation_curve_y = [1.0, 0.65, 0.43, 0.32, 0.29, 0.29, 0.32, 0.43, 0.65, 1.0]
saturation_f = interpolate.interp1d(saturation_curve_x, saturation_curve_y, kind='quadratic')
# Lightness needs to start at 31%, quickly scale to 'kiwi_lightness', then to 50%. Use a cubic function.
lightness_curve_x = np.linspace(0, 1, 12)
lightness_curve_y_a = np.linspace(0.31/kiwi_lightness, 1.0, 4)
lightness_curve_y_b = np.linspace(1.0, 1.0, 7)
lightness_curve_y_c = np.linspace(1.03, 0.5/kiwi_lightness, 3)
lightness_curve_y = np.concatenate((lightness_curve_y_a[0:3], lightness_curve_y_b, lightness_curve_y_c[1:3]))
lightness_curve_y = [min(x * kiwi_lightness, 1.0) for x in lightness_curve_y]
lightness_f = interpolate.interp1d(lightness_curve_x, lightness_curve_y, kind='cubic')
# Plot curves
xnew = np.linspace(0, 1, 200)
saturation_new = saturation_f(xnew)
lightness_new = lightness_f(xnew)
fig = plt.figure(figsize=(10, 10))
ax = plt.axes()
fig.patch.set_facecolor('white')
ax.set_title("HLS curves\nLightness = %.2f" % kiwi_lightness)
ax.scatter(saturation_curve_x, saturation_curve_y, color='red', label='saturation')
ax.plot(xnew, saturation_new, color='red')
ax.scatter(lightness_curve_x, lightness_curve_y, color='blue', label='lightness')
ax.plot(xnew, lightness_new, color='blue')
ax.legend()
plt.show()
plt.close()
# generate HLS ramps
num_years = end_year - start_year + 1
num_preceding_years = max(0, start_year - 2012)
num_years_total = num_years + num_preceding_years
hues = np.linspace(0, (5.0/6.0), num=num_years)
saturations = saturation_f(np.linspace(0, 1, num=num_years))
lightnesses = lightness_f(np.linspace(0, 1, num=num_years))
hlss = zip(hues, lightnesses, saturations)
rgbs = [colorsys.hls_to_rgb(x[0], x[1], x[2]) for x in hlss]
# add preceding year(s)
preceding_rgbs = [rgbs[0]]*num_preceding_years
rgbs = preceding_rgbs + rgbs
# plot on each background
fig, axs = plt.subplots(2, figsize=(15, 6))
fig.patch.set_facecolor('white')
fig.suptitle("Color ramp for years 2012–%d\nLightness = %.2f" % (end_year, kiwi_lightness))
axs[0].set_facecolor('#42464d')
axs[1].set_facecolor('white')
for ax in axs:
ax.scatter(np.arange(2012, end_year+1), [0]*num_years_total, color=rgbs, s=600)
ax.xaxis.set_major_locator(mticker.MultipleLocator(1.0))
ax.set_yticks([])
plt.show()
plt.close()
# return as list of rgbs in range 0-255
rgbs2 = []
for r, g, b in rgbs:
rgbs2.append((min(int(r * 256), 255), min(int(g * 256), 255), min(int(b * 256), 255)))
return rgbs2
# examples
create_kiwi_color_ramp_hls(2024)
create_kiwi_color_ramp_hls(2028, kiwi_lightness=0.6)
import colorsys
import numpy as np
from scipy import interpolate
import matplotlib.pyplot as plt
import matplotlib.ticker as mticker
# Generate a rainbow color ramp from Oldhead red to Newfriend pink, starting in 2012.
# end_year: Final year of color ramp.
# start_year: First year to begin "ramping." The start_year and all years before start_year will be Oldhead red.
# kiwi_brightness: Reference brightness of Kiwi green. Increase to make color ramp brighter.
def create_kiwi_color_ramp(end_year, start_year=2013, kiwi_brightness=0.65):
# Use HSV colorspace to create color ramp. Use generic points to define the curves.
# Saturation and brightness (value) should stay in the neighborhood of Kiwi green.
# Kiwi green: (H=109°, S=43%, V=65%)
# Oldhead red: (H=0°, S=100%, V=62%)
# Newfriend pink: (H=300°, S=100%, V=100%)
# Saturation needs to start at 100%, go down to 43%, and back up to 100%. Use a quadratic function.
saturation_curve_x = np.linspace(0, 1, 10)
saturation_curve_y = [1.0, 0.72, 0.55, 0.46, 0.43, 0.43, 0.46, 0.55, 0.72, 1.0]
saturation_f = interpolate.interp1d(saturation_curve_x, saturation_curve_y, kind='quadratic')
# Brightness needs to start at 62%, quickly scale to 'kiwi_brightness', then to 100%. Use a cubic function.
brightness_curve_x = np.linspace(0, 1, 12)
brightness_curve_y_a = np.linspace(0.62/kiwi_brightness, 0.97, 4)
brightness_curve_y_b = np.linspace(0.97, 1.03, 7)
brightness_curve_y_c = np.linspace(1.03, 1.0/kiwi_brightness, 3)
brightness_curve_y = np.concatenate((brightness_curve_y_a[0:3], brightness_curve_y_b, brightness_curve_y_c[1:3]))
brightness_curve_y = [min(x * kiwi_brightness, 1.0) for x in brightness_curve_y]
brightness_f = interpolate.interp1d(brightness_curve_x, brightness_curve_y, kind='cubic')
# Plot curves
xnew = np.linspace(0, 1, 200)
saturation_new = saturation_f(xnew)
brightness_new = brightness_f(xnew)
fig = plt.figure(figsize=(10, 10))
ax = plt.axes()
fig.patch.set_facecolor('white')
ax.set_title("HSV curves\nBrightness = %.2f" % kiwi_brightness)
ax.scatter(saturation_curve_x, saturation_curve_y, color='red', label='saturation')
ax.plot(xnew, saturation_new, color='red')
ax.scatter(brightness_curve_x, brightness_curve_y, color='blue', label='brightness')
ax.plot(xnew, brightness_new, color='blue')
ax.legend()
plt.show()
plt.close()
# Generate HSV ramps
num_years = end_year - start_year + 1
num_preceding_years = max(0, start_year - 2012)
num_years_total = num_years + num_preceding_years
hues = np.linspace(0, (5.0/6.0), num=num_years)
saturations = saturation_f(np.linspace(0, 1, num=num_years))
values = brightness_f(np.linspace(0, 1, num=num_years))
hsvs = zip(hues, saturations, values)
rgbs = [colorsys.hsv_to_rgb(x[0], x[1], x[2]) for x in hsvs]
# add preceding year(s)
preceding_rgbs = [rgbs[0]]*num_preceding_years
rgbs = preceding_rgbs + rgbs
# Plot on each background
fig, axs = plt.subplots(2, figsize=(15, 6))
fig.patch.set_facecolor('white')
fig.suptitle("Color ramp for years 2012–%d\nBrightness = %.2f" % (end_year, kiwi_brightness))
axs[0].set_facecolor('#42464d')
axs[1].set_facecolor('white')
for ax in axs:
ax.scatter(np.arange(2012, end_year+1), [0]*num_years_total, color=rgbs, s=600)
ax.xaxis.set_major_locator(mticker.MultipleLocator(1.0))
ax.set_yticks([])
plt.show()
plt.close()
# Return as list of rgbs in range 0-255
rgbs2 = []
for r, g, b in rgbs:
rgbs2.append((min(int(r * 256), 255), min(int(g * 256), 255), min(int(b * 256), 255)))
return rgbs2
# examples
create_kiwi_color_ramp(2024)
create_kiwi_color_ramp(2028, kiwi_brightness=0.75)
Because pinkWhy not make new members rainbow colored to show how gay they are?
i never talk about it, slav power did them on request before.Whoa, I didn't know these changed. Is this something that happens every year and I just didn't notice until now?
I agree with this, in fact the red color I suggested was in regards to the Dark-theme (the default, which most people use), and I think that the others work just as well in Dark-mode.Could you set it so the lighter joindate colors show up in dark mode, and vice versa? Just re-read the OP and noticed that's how it was before. Thanks by the way
Never out your own parachute account (nigga)I'm glad I'm not pink anymore but it would be cool if there was a special badge for me and all my niggas who have 2022 registration dates but lost our old accounts in the password reset purge.
My username is literally "Xarpho's Return" as opposed to the original 2014 "Xarpho".Never out your own parachute account (nigga)