Skip to content

Instantly share code, notes, and snippets.

View cyross's full-sized avatar

Cyross Makoto cyross

View GitHub Profile
@cyross
cyross / hex2aco.py
Created November 9, 2025 10:37
HEX(6桁の16進数のリスト)から.acoファイルを生成するPythonスクリプト
import struct
import sys
def parse_hex_color(hex_str):
"""6桁の16進数文字列をR, G, Bのタプル(0-255)に変換する"""
hex_str = hex_str.strip().lstrip('#')
if len(hex_str) != 6:
return None
try:
r = int(hex_str[0:2], 16)
@cyross
cyross / step2hex.py
Last active November 9, 2025 10:38
昔のPCの色を24ビットカラーRGBで近似的にHEXファイルに出力するPythonスクリプト(aseprite等で利用可能)
# 各PC/OSの段階形式に基づいてRGB16進数カラーパレットファイルを近似的に生成する
import sys
valid_types = {"8", "512", "4K", "32K", "X68", "Win64K"}
def create_color_steps(step, max = 255, base = 0):
parameter = step - 1
return [round(max * i / parameter) + base for i in range(step)]
@cyross
cyross / erase_ds_store.py
Created September 22, 2024 04:41
指定ディレクトリ内の .DS_Store ファイルを削除する Python スクリプト
#! /usr/bin/python
# -*- coding: utf-8 -*-
"""概要
指定ディレクトリ内の .DS.Store ファイルを削除
サブディレクトリでも再帰的に検索して削除
python erase_ds_store.py -d [directory]
2024 Cyross
@cyross
cyross / InsertNewLineUnicodeForHidemaru.mac
Last active November 10, 2022 03:42
秀丸でUnicodeのNewLineを挿入するマクロ(Fortnite用)
// フォートナイトのクリエイティブで
// ビルボードやポップアップの文字列に改行を挿入するマクロ
// 参考:
// http://www.unicode-symbol.com/u/0085.html
// https://www.reddit.com/r/FortniteCreative/comments/kguiv6/how_do_you_make_multiple_lines_of_text/
insert "\u0085";
using SQLite;
namespace Assets.Scripts.Model.Character
{
public class CharacterBase
{
[PrimaryKey, AutoIncrement]
[Column("id")]
public int Id { get; set; }
using System;
using UnityEngine;
using UniRx;
public class HitScheduler : MonoBehaviour
{
[SerializeField]
private float _HitsLowTime = 1.0f;
[SerializeField]
private float _HitsLowScale = 0.45f;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace DG.Tweening
{
public class CameraController : MonoBehaviour
{
[SerializeField]
private Camera mycamera;
using UnityEngine;
public class TestScript : MonoBehaviour
{
[Header("UnityのVector3構造体の配列")]
public Vector3[] Vs2;
// Start is called before the first frame update
void Start()
{
using System;
using System.Collections.Generic;
using UnityEngine;
[Serializable]
public class TestStruct
{
public Sprite Sptite;
public AnimationClip Animation;
}
using UnityEngine;
public class TestScript : MonoBehaviour
{
[Header("UnityのVector3構造体の配列")]
public Vector3[] Vs2 = new Vector3[1] { new Vector3() };
// Start is called before the first frame update
void Start()
{